CF382B Number Busters 题解
总共就两种情况。
当
当
如果
每一次循环判断
代码:
#include<bits/stdc++.h>
using namespace std;
int a,b,c,w,x;
int main(){
cin>>a>>b>>w>>x>>c;
int res=0;//时间
while(c>a){//一直循环
if(b<x)
{
a--;
b+=w;
}
c--;
b-=x;
res++;//每一回合秒数+1
}
cout<<res;
return 0;
}