View Code of Problem 3791

#include<stdio.h>
#include<math.h>
#include<algorithm>

double p=(sqrt((double)5)+1)/double(2);
int main (){
    int a,b,c;
        while(scanf("%d%d",&a,&b)!=EOF){
        c=abs(a-b);
        a=a>b?b:a;
        if(a==(int)(p*c)) printf("0\n");
        else printf("1\n");
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 3791