Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
请高手帮忙看看! 用经过的路程来判断速度是否提高,不用做除法,可就是WA,没办法了吗?#include <iostream.h> int main() { int n,i,v,t,road; int rider[10001][2]; while(1) { cin>>n;v=0;road=16200; if(n==0)break; for(i=0;i<n;i++) cin>>rider[i][0]>>rider[i][1]; for(i=0;i<n;i++) if(rider[i][1]==0) v=(v>rider[i][0]?v:rider[i][0]); for(t=0;road>0;road=road-v) { for(i=0;i<n;i++) if(rider[i][0]>v) if(rider[i][0]*(t-1-rider[i][1])<=16200-road& &rider[i][0]*(t-rider[i][1])>=16200-road) v=rider[i][0]; t++; } cout<<t<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator