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

为什么所有BT的数据我都已经过了,却还是WA呢?????(附有代码和BT数据)

Posted by Correct at 2008-08-02 22:06:11 on Problem 1006
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int p, e, i, d, n=1, res=0;
int main()
{
	while(scanf("%d%d%d%d",&p, &e, &i, &d))
	{
		int j;
		if(p==-1)
			break;
		p%=23;
		e%=28;
		i%=33;
		for(j=p+1; (j-p)%23; j++);
		for(; (j-e)%28; j+=23);
		for(; (j-i)%33; j+=23*28);
		res=j-d;
		res%=21252;
		if(res==0)
			res=21252;
		printf("Case %d: the next triple peak occurs in %d days.\n",n,res);
		n++;
	}
	return 0;
}
		


/*
0 4 5 0
2 2 2 2
123 128 133 1
123 128 133 100
0 1 2 1
1 0 2 1
1 2 0 1
1 2 3 0
117 58 2 27
24 29 34 0     
24 29 34 1          
24 29 34 2         
0  0  0  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