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

Re:求助啊~为什么我的结果正确,但是总是WA?

Posted by kemaosen at 2008-11-23 11:56:53 on Problem 1006
In Reply To:求助啊~为什么我的结果正确,但是总是WA? Posted by:Daisy1 at 2008-11-21 14:06:20
> #include <iostream>
> using std::cin ;
> using std::cout ;
> 
> int main(){
> 	int a[100][4] = {0} ;
> 	int num = 0 ;
> 	int days = 0 ;
> 	int l = 0 ;
> 	for (int i = 0 ; i<100 ; i++)
> 	{
> 		for(int j=0;j<4;j++)
> 		{
> 			cin >> a[i][j] ;
> 			if (a[i][j] == -1)
> 			{
> 			  num++ ;
> 			}
> 		}
> 		if (num==4)
> 		{
> 			l = i ;
> 			break ;
> 		}
> 	}
> 
> 	for(int m = 0 ; m < l ;m++)
> 	{
> 		
> 		
> 			for(int k = 1; k <= 21252 ;k++)
> 			{
> 		         if ( (k-(23-(a[m][3]-a[m][0])))%23==0 && (k-(28-(a[m][3]-a[m][1])))%28==0 && (k-(33-(a[m][3]-a[m][2])))%33 == 0)
> 				 {
> 		             days = k ;
> 					if (days > 23*28*33)
> 					{
> 							days -=  23*28*33 ;
> 					}
> 						cout << "Case "<< m+1 << ": the next triple peak occurs in "<<days<<" days." << "\n"  ;
> 				 }
> 				 
> 			}
> 		
> 	
> 	}
> 
> 
>               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