您的位置:首页 > 编程语言

CodeForces - 820A Mister B and Book Reading

2017-08-31 15:36 369 查看
//水题
#include <bits/stdc++.h>
using namespace std;
int main()
{
int c, v0, v1, a, l;
while (cin >> c >> v0 >> v1 >> a >> l)
{
int day = 0;
if (v0 >= c)
{
cout << 1 << endl;
continue;
}

day++; c -= v0;
int flag = 1;
while (1)
{
c += l;
v0 += a;
if (v0 > v1) v0 = v1;

if (v0 >= c)
{
flag = 0;
cout << ++day;
break;
}
c -= v0; day++;
}
if (!flag) continue;
else cout << day << endl;
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ACM 算法 编程 codeforces