| ||||||||||
| 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 | |||||||||
哈哈哈,我也有一次通过的时候/*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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator