| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
WA 了好多次了 帮帮忙看看 我真不知道哪不对 谢谢了#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator