结论题 不看结论根本不会 只能打表Orz
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<cmath>
#define SF scanf
#define PF printf
#define max(a, b) ((a) < (b) ? (b) : (a))
using namespace std;
typedef long long LL;
const int MAXN = 25;
int SG[MAXN+10], n, A[MAXN+10];
bool vis[MAXN*2+10];
int main()
{
double a = (1 + sqrt(5)) / 2;
int n, m;
while(~SF("%d%d", &n, &m))
{
if(n > m) swap(n, m);
int d = m - n;
if((int) (d * a) == n) puts("0");
else puts("1");
}
}