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:有没有哪位上帝天使耶稣来救求我?????WAWAWA!!!!

Posted by Blackfall at 2008-03-27 21:56:49 on Problem 1006
In Reply To:有没有哪位上帝天使耶稣来救求我?????WAWAWA!!!! Posted by:mThunder at 2007-11-22 15:02:58
> 神们,所有变态的、不变态的、有一点点变态的数据都测了,怎么还是WA呢?????
> #include<iostream>
> using namespace std;
> 
> int main()
> {
> 	int input[100][4];
> 	int i,j,k=0;
> 	for(i=0;i<100;i++){
> 		scanf("%d%d%d%d",&input[i][0],&input[i][1],&input[i][2],&input[i][3]);
> 		if(input[i][0]==-1)
> 			break;
> 		k++;
> 	}
> 	for(i=0;i<k;i++){
> 		for(j=0;;j++){
> 			int sum=23*j+input[i][0];
> 			if((sum-input[i][1])%28==0&&(sum-input[i][2])%33==0){
> 				int result;
> 				if(sum-input[i][3]>21252){
> 					result=sum-21252-input[i][3];
> 				}
> 				else if(input[i][3]>=sum){
> 					result=sum+21252-input[i][3];
> 				}
> 				else 
> 					result=sum-input[i][3];
> 				printf("Case %d: the next triple peak occurs in %d days.\n",i+1,result);
> 				break;
> 			}//end of if
> 		}//end of for j
> 	}//enf of for i
> 	return 0;
> }
> -------------------------------------------------------------------------
> 测试用的数据包括:
> //24 29 34 0           1
> //24 29 34 1           21252
> //24 29 34 2           21251
> //0  0  0  0           21252
> 以及题中提供的样本。
> 神们,救命~~

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