| ||||||||||
| 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的注意了In Reply To:欲哭无泪,谁能帮我看看,我这代码是什么原因WA了~~~ Posted by:gbastc at 2011-07-08 21:54:50 4
25 -155
20 0
27 190
30 240
先试试这组数据
楼上的代码应改为:
#include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;
#define MIN 1e-8
int main()
{
int n,i,v,t;
double ans;
while(scanf("%d",&n),n)
{
ans=INT_MAX;
for(i=0;i<n;i++)
{
scanf("%d%d",&v,&t);
if(3.6*4500/v+t<ans&&t>=0)
ans=3.6*4500/v+t;
}
if(ans-int(ans)>0.0)
printf("%d\n",int(ans)+1);
else printf("%.lf\n",ans);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator