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 greendexiaohao at 2008-03-31 20:34:12 on Problem 1067
#include<stdio.h>
#include<math.h>
#define F sqrt(5)

int main(void)
{
	long a=0;
	long b=0;
	long big=0;
	long tin=0;
	long j=0;
//	freopen("t.txt","r",stdin);
	while(scanf("%ld %ld",&a,&b)!=EOF)
	{
	big=a>b?a:b;
	tin=a>b?b:a;
	j=(long)(tin*(F-1)/2);
	if(big==2&&tin==1)
		printf("0\n");
	else if(tin==(long)(j*(F+1)/2)&&big==tin+j)
		printf("0\n");
	else if(tin==((long)((j+1)*(F+1)/2))&&b==tin+j+1)
		printf("0\n");
	else if(tin==((long)((j-1)*(F+1)/2))&&b==tin+j-1)
		printf("0\n");
	else
		printf("1\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