| 比赛 | Mister B的奇妙生活 | 评测结果 | AWWAWAWAWA |
|---|---|---|---|
| 题目名称 | B先生和阅读 | 最终得分 | 50 |
| 用户昵称 | I love study | 运行时间 | 0.004 s |
| 代码语言 | C++ | 内存使用 | 0.31 MiB |
| 提交时间 | 2017-09-08 21:15:09 | ||
#include<iostream>
#include<cstdio>
using namespace std;
int c,v0,v1,a,p,z,x,v;
int main()
{
freopen("MrBA.in","r",stdin);
freopen("MrBA.out","w",stdout);
cin>>c>>v0>>v1>>a>>p;
z=1;
x=v0;
v=v0;
if (c<=v0) cout<<1;
else {
while (x<c)
{
v=v0+a*z+p;
if(v>v1)
{
x=x+v1-p;
z=z+1;
}
else
{
x=x+z*a+v0;
z=z+1;
}
}
cout<<z<<endl;
}
fclose(stdin);fclose(stdout);
}