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

哈哈哈,我也有一次通过的时候

Posted by ning at 2005-12-18 11:15:21 on Problem 1922
/*pku1922 Ride to School  051218*/
#include<stdio.h>
#define N 100
int main()
{
    int arr_time,last;
    int num;
    int ii,jj,kk;
    int speed;
    float tmp;
    for(;scanf("%d",&num);)
    {
        if(!num)
            return 1;
        for(ii=0,last=10000;ii<num;ii++)
        {
            scanf("%d%d",&speed,&kk);
            if(kk>=0)
            {
                tmp=3600*4.5/speed+kk;
                /*printf("tmp:%f  %d",tmp,(int)tmp);*/
                if(tmp-(int)tmp<.001)
                    arr_time=(int )tmp;
                else
                    arr_time=1+(int )tmp;
                last= ( arr_time<last)?arr_time:last;
                /* printf("last%d",last);*/
            }
        }
        printf("%d\n",last);
    }
}

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