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 gbastc at 2011-07-08 22:16:44 on Problem 1922
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:
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