我没啥好说的。
见威佐夫博弈:
http://www.cppblog.com/coreBugZJ/archive/2012/06/04/177481.html
http://blog.csdn.net/angle555945/article/details/7417722
1067 | Accepted | 176K | 16MS | C++ | 655B |
/*
ID: thestor1
LANG: C++
TASK: poj1067
*/
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <limits>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <cassert>
using namespace std;
int main()
{
int a, b;
double p = (sqrt((double)5) + 1) / 2;
while (scanf("%d%d", &a, &b) != EOF)
{
if (a > b)
{
int tmp = a;
a = b;
b = tmp;
}
if (a == (int)((b - a) * p))
{
printf("0\n");
}
else
{
printf("1\n");
}
}
return 0;
}