CodeForces 148BEscape(数学)

来源:互联网 发布:淘宝上的宝贝怎么上架 编辑:程序博客网 时间:2024/06/05 23:02
#include<iostream>#include<cstdio>#include<algorithm>#include<cstdlib>using namespace std;typedef long long ll;ll ans[120];#define sp  system("pause");int main(){double vd, vp, t, f, c;cin >> vp >> vd >> t >> f >> c;if (vp >= vd){cout << 0 << endl;return 0;}double pos = t * vp;int st = 0;while (pos < c){pos += pos / (vd - vp) * vp;//cout << "in\n";//cout << pos << endl;if (pos >= c)break;st++;double tim = pos / vd;pos += (tim + f) * vp;//pos += pos / (vd - vp) * vp;}cout << st << endl;return 0;}
0 0
原创粉丝点击