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

过不去了,求帮助,指点如何减少runtime

Posted by dash007 at 2010-12-07 14:18:41 on Problem 1006
#include <iostream>
using namespace std;
#define MAX 10

int main()
{
	int count=0;
	int i=-1;
	int PHY,EMO,INTE,DATE;
	int BIO[MAX];
	do
	{
		i++;
		cin>>PHY>>EMO>>INTE>>DATE;
		BIO[i]=(5544*PHY+14421*EMO+1288*INTE-DATE+21252)%21252; 
		if(BIO[i]==0)
		{
			BIO[i]=21252;
		}			
	}while(PHY!=-1);
	for(int j=0;j<i;j++)
	{	
		cout <<"Case "<< j++ <<": the next triple peak occurs in " <<BIO[j]<<" days."<<endl;
	}
	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