原题链接:​​http://poj.org/problem?id=1067​

AC代码:

#define _CRT_SECURE_NO_DEPRECATE

#include<iostream>
#include<vector>
#include<cstring>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<string>
#include<stdio.h>
#define INF 1000000000
#define EPS 1e-6
using namespace std;

int n, m;

int main()
{
while (~scanf("%d%d", &n, &m))
{
if (n > m)
swap(n, m);

int k = m - n;
double x = (1 + sqrt(5.0)) / 2;
int first = k*x;
if (first == n)
printf("0\n");
else
printf("1\n");
}
return 0;
}