记录编号 | 30143 | 评测结果 | AAAAA | ||
---|---|---|---|---|---|
题目名称 | 102.[NOIP 2002]自由落体 | 最终得分 | 100 | ||
用户昵称 | 是否通过 | 通过 | |||
代码语言 | C++ | 运行时间 | 0.002 s | ||
提交时间 | 2011-10-27 20:03:47 | 内存使用 | 0.26 MiB | ||
#include <cstdio> #include <cmath> using namespace std; int main(void) { freopen("freefaller.in","r",stdin); freopen("freefaller.out","w",stdout); int i,n,c=0; double H,S1,V,L,K,t,x,l,r;//0.00001 scanf("%lf %lf %lf %lf %lf %d",&H,&S1,&V,&L,&K,&n); t=sqrt(2*(H-K)/10); x=V*t; l=S1-x; r=l+L; t=sqrt(2*H/10); x=V*t; l=S1-x; l-=0.00001; r+=0.00001; if (r>n-1) r=n-1; for (i=0;i<n;i++) if (i>=l&&i<=r) c++; printf("%d\n",c); fclose(stdin); fclose(stdout); return(0); }