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

help!why WA,can anyone give me some data to test?

Posted by erps at 2007-04-28 23:15:01 on Problem 3219
#include <iostream>
using namespace std;

int main()
{
	unsigned long n, k;
	bool even;
	while (cin>>n>>k)
	{
		k=min(n-k,k);
		if (k>=4)
		{
			even=true;
		}
		else
		{
			switch(k)
			{
			case 0:
				even=false;
				break;
			case 1:
				even=(n%2==0);
				break;
			case 2:
				even=(n%4==0||(n-1)%4==0);
				break;
			case 3:
				even=(n%2==0||(n-1)%4==0);
				break;
			}
		}
		cout<<(even?0:1)<<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