比赛 |
小练习赛:B组 |
评测结果 |
AAAAA |
题目名称 |
自由落体 |
最终得分 |
100 |
用户昵称 |
mzy |
运行时间 |
0.001 s |
代码语言 |
C++ |
内存使用 |
0.31 MiB |
提交时间 |
2014-10-21 18:46:33 |
显示代码纯文本
# include <iostream>
# include <cstdio>
# include <cmath>
using namespace std;
const double eps = 0.00001;
double t,y,y2;
double h,s,v,l,k;
int n,ans=0;
int main()
{
freopen("freefaller.in", "r", stdin);
freopen("freefaller.out", "w", stdout);
scanf("%lf%lf%lf%lf%lf%d", &h, &s, &v, &l, &k, &n);
t = sqrt(0.2*(h-k));
y = s-v*t;
y2 = y+l;
t = sqrt(0.2*h);
y = s-v*t;
for (int i=0;i<n;++i)
if (i>=y-eps && i<=y2+eps)
ans++;
printf("%d\n", ans);
return 0;
}