比赛 啦啦啦,一星期两次的水题赛 评测结果 C
题目名称 自由落体 最终得分 0
用户昵称 Golden Dawn 运行时间 0.000 s
代码语言 C 内存使用 0.00 MiB
提交时间 2014-10-28 19:58:32
显示代码纯文本
  1. #include<iostream>
  2. #include<stdio.h>
  3. #include <math.h>
  4. using namespace std;
  5. int p[100001],q[100001];
  6. double s;
  7. int main(){
  8. freopen("freefaller.in","r",stdin);
  9. freopen("freefaller.out","w",stdout);
  10. //d=1/2*g*(t^2),其中 g=10,t 为下落时间。地面上的小车以速度 V 前进。
  11. double l,v,k,h,r,tx;
  12. int n,w,e,i,wa,we,a,b,c;
  13. //天花板高度Hx,车长L,车速V, 车高为K
  14. cin>>h>>s>>v>>l>>k>>n;//H,S,V,L,K,n (l<=H,S1,V,L,K,n <=100000)
  15. h=h-k; s=s-n; tx=sqrt(h/5); // tx表示球落至车高度下的时间 到小车<= 0.00001 时,被接受
  16. w=v*tx+0.00001; //w为车头处
  17. e=w-l; //e为车尾处
  18. wa=w/1;
  19. we=e/1;
  20. c=wa-we-1;
  21. cout<<c;
  22. return 0;
  23. }