http://acm.pku.edu.cn/JudgeOnline/problem?id=1067

Код:
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
 int ax,bx,temp;
 int k;
 double wantedax;
 while(scanf("%d%d",&ax,&bx)==2){   
 if(ax>bx){
  temp = bx;
  bx = ax;
  ax = temp;
 }
 k = bx - ax;
 wantedax = (floor)( k*(1.0+sqrt(5))/2.0 );
 if(ax==wantedax)printf("%d\n",0);
   else printf("%d\n",1);
 }
}