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

谁帮我看看这个为什么WA, 测试包括下面的特殊数据都过了~~

Posted by lovepal4 at 2012-02-22 10:08:57 on Problem 1006
#include <iostream>
#include <vector>
using namespace std;

int main()
{
	int n[4];
	vector<int> vn[4];
	while(cin>>n[0]>>n[1]>>n[2]>>n[3])
	{
		if(n[0]==-1&& n[1]==-1&& n[2]==-1&& n[3]==-1) break;
		for(int i(0); i<4; ++i)
			vn[i].push_back(n[i]);
	}

	for(size_t i(0); i<vn[0].size(); ++i)
	{
		int d = max(max(vn[0][i],vn[1][i]),vn[2][i]);
		if(d == vn[0][i])
		{
			while((d-vn[1][i])%28 !=0 ||(d-vn[2][i])%33 !=0)
				d+=23;
		}
		else if(d == vn[1][i])
		{
			while((d-vn[0][i])%23 !=0 ||(d-vn[2][i])%33 !=0)
				d+=28;
		}
		else
		{
			while((d-vn[0][i])%23 !=0 ||(d-vn[1][i])%28 !=0)
				d+=33;
		}
		if(d<=vn[3][i]) d=23*28*33-vn[3][i];
		else d= (d-vn[3][i]-1)%21252+1;
		cout <<"Case "<<i+1<<": the next triple peak occurs in "<<d<<" 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