View Code of Problem 197

#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stdio.h>
#include<string.h>
#include<cmath>
using namespace std;
int main()
{
   int a,b;
   while(cin>>a>>b)
    {
        if(a>b)
            swap(a,b);
        int c=(int)((b-a)*(sqrt(5)+1)/2);
        if(c==a)
       cout<<0<<endl;
       else cout<<1<<endl;
    }
   return 0;
}

Double click to view unformatted code.


Back to problem 197