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

请教诸位,哪里错了

Posted by c0053 at 2006-05-21 15:42:54 on Problem 1063
#include <stdio.h>

int main()
{
	int num,t,i,z,j,o;
	int a[35];
	freopen("in.txt","r",stdin);
	scanf("%d",&t);
	for(z=0;z<t;z++)
	{
		j=o=0;
		scanf("%d",&num);
		if(num%2==1)
		{
			printf("YES\n");
			continue;
		}	
		for(i=0;i<num;i++)
		{
			scanf("%d",&a[i]);
			if(a[i]==1)
			{
				if((i+1)%2==1)
					j++;
				else 
					o++;
			}
		}	
		if(j-o<=1&&j-0>=-1)
			printf("YES\n");
		else
			printf("NO\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