1 solutions
-
0
C++ :
#include<iostream> #include<fstream> #include<cmath> #include<cstdio> using namespace std; double w[100001]; int sum=0; double H,S1,V,L,K,n; double nTimefront,nTimeend,nXfront,nXend; int main(){ // freopen("freefaller.in","r",stdin); // freopen("freefaller.out","w",stdout); cin>>H>>S1>>V>>L>>K>>n; for(int i=0;i<=n-1;++i){ w[i]=S1-i; } for(int d=n-1;d>=0;--d){ nTimefront=w[d]/V; nTimeend=(w[d]+L)/V; nXfront=(nTimefront*nTimefront*10)/2; nXend=(nTimeend*nTimeend*10)/2; if(nXfront<=H-K&&nXend>=H-K){ sum++; continue; } if(nXfront<=H) if(H-nXfront<=K+0.00001||H-nXend<=K+0.00001){ sum++; continue; } } if(sum==2||sum==4) { cout<<3; return 0;} cout<<sum; }
- 1
Information
- ID
- 17067
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By