| Time Limit: 1000MS | Memory Limit: 10000K | |
| Total Submissions: 35727 | Accepted: 12065 |
Description
Input
Output
Sample Input
2 1 8 4 4 7
Sample Output
0 1 0
转载请申明:http://blog.csdn.net/lionel_d
典型的威佐夫博奕模型,虽然感觉很难的样子,,可是用别人推出来的公式,,就变得很简单了
上一个博客:http://www.cnblogs.com/celia01/archive/2011/11/15/2250171.html
里面博弈模型挺全的。
代码:
#include <stdio.h>
#include <math.h>
int main()
{
double p = (sqrt(5.0)+1)/2 ;
int a , b ;
while(~scanf("%d%d",&a,&b))
{
if(a>b)
{
int temp = a;
a = b;
b = temp ;
}
int j = b - a ;
if(a == (int)(j*p))
{
puts("0") ;
}
else
{
puts("1") ;
}
}
return 0 ;
}hdu1527 & poj1067 取石子游戏 威佐夫博奕模型,,模板题o(╯□╰)o
原文地址:http://blog.csdn.net/lionel_d/article/details/43936745