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

求牛人看一下,这个为什么总是wrong answer

Posted by shiyan at 2005-03-01 11:05:26 on Problem 1922
#include<iostream.h>
#include<math.h>
void main(){
	int n,k;	
	int *Speed,*setTime,goalTime=0,temp; 
	while(1){		
		cin>>n;
		if (n==0)break;
		Speed=new int[n];
		setTime=new int[n];
		for(k=0;k<n;k++){
			cin>>Speed[k]>>setTime[k];
		}
		for(k=0;k<n;k++){
			if(setTime[k]>=0){				
				temp=int(ceil(setTime[k]+double(4.5)/Speed[k]*3600));
				if(goalTime==0)goalTime=temp;
				else if(goalTime>temp)
					goalTime=temp;
			}
		}
		cout<<goalTime<<endl;
		delete Speed;
		delete setTime;
	}
	return;
}

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