今天专门弄下博弈这一块,博弈分类参考链接
其实就是博弈的题目一部分是属于一类的,解体的公式都是一样的,只要找清楚题目是哪一类博弈,然后套下公式就行。
#include <cstdio>
#include <iostream>
#include <set>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <stack>
#define ll long long
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b)
{
if(a > b)
swap(a,b);
double x = (b - a) * (1 + sqrt(5)) / 2;
if(a == (int)x)
cout<<"0"<<endl;
else
cout<<"1"<<endl;
}
return 0;
}