| ||||||||||
| 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 | |||||||||
Re:...想明白了你会发现很简单。。。看讨论的人比较多,,我也来说说,,呵呵In Reply To:...想明白了你会发现很简单。。。看讨论的人比较多,,我也来说说,,呵呵 Posted by:TangMing at 2009-08-12 19:54:58
确实水~
就是求最早到的时间~
顶!
Problem: 1922 User: 810974380
Memory: 368K Time: 0MS
Language: C Result: Accepted
Source Code
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int a[10001],b[10001];double c[10001];
int n,i;double x,res;
int main()
{
while(scanf("%d",&n))
{
if(n==0) break;
for(i=0;i<n;i++)
{
scanf("%d%d",&a[i],&b[i]);
if(b[i]>=0) c[i]=b[i]+(4.5*3600*1.0/a[i]);
else c[i]=10000000;
}
x=10000000.0;
for(i=0;i<n;i++)
if(x>c[i]) x=c[i];
res=ceil(x*1.0);
printf("%d\n",(int)res);
}
system("pause");
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator