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 tdzl2003 at 2005-03-11 12:15:29 on Problem 1067
#include <stdio.h>

int main()
{
	int m,n;
	int a[10000],b[10000];
	int i,j,k,l;
	while (scanf("%d",&m)==1)
	{
		scanf("%d",&n);
		if (n<m)
		{
			i=m;m=n;n=i;
		}
		a[0]=1;b[0]=2;
		if (m==2)
		{
			printf("1\n");
			continue;
		}
		if (m==1)
		{
			printf("%d\n",n==2?0:1);
			continue;
		}
		if (m&&n==0)
		{
			printf("1\n");
			continue;
		}
		{
			l=0;i=1;j=0;k=1;
			while (1)
			{
				k++;i++;
				if (i==b[j])
				{
					i++;
					j++;
				}
				a[++l]=i;
				b[l]=i+k;
				if (i==n)
				{
					printf("1\n");
					break;
				}
				if (i==m)
				{
					printf("%d\n",i+k==n?0:1);
					break;
				}
			}
		}
	}
	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