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

为什么是OLT ??第一次遇到

Posted by dododo at 2008-02-26 12:20:40 on Problem 1740
#include <iostream.h>

int main()
{
	int i,n;
	int t;
	bool find;
	int p[101];
	while (1)
	{
		cin>>n;
		if (n==0)
			break;
		if (n%2==1)
		{
				cout<<"1"<<endl;
		}
		else
		{
			for (i=0;i<=100;i++)
				p[i]=0;
			find = 0;
			for (i=1;i<=n;i++)
			{
				cin>>t;
				p[t]++;
			}
			for (i=1;i<=100;i++)
			{
				if (p[i]%2==1)
					find=1;
			}
			if (find)
				cout<<"1"<<endl;
			else
				cout<<"0"<<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