Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

请高手帮忙看看! 用经过的路程来判断速度是否提高,不用做除法,可就是WA,没办法了吗?

Posted by radish at 2005-02-17 01:20:11 on Problem 1922
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator