题解 P3926 【SAC E#1 - 一道不可做题 Jelly】

· · 题解

我来发一道c的题解

#include <bits/stdc++.h>
using namespace std;
long long a,c,p,q,r,x,jdt,t;
int main()
{
    cin>>a>>c>>p>>q>>r>>x;
    jdt=p*(c-a);
    if (jdt>0)
        if (jdt>=x) t=a+floor((x*1.0)/p);
        else if (jdt+q>=x) t=c;//解冻中
             else t=c+floor(((x-jdt-q)*1.0)/r);
    if (jdt==0)
        if (x<=q) t=c;
        else t=c+floor(((x-q)*1.0)/r);
    if (jdt<0)
        t=a+floor((x*1.0)/r);
    cout<<t;
    return 0;
}

加油,大佬么!