POJ.1067 取石子游戏 (博弈论 威佐夫博弈)
题意分析
简单的威佐夫博弈
博弈论快速入门
代码总览
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
int n,m;
while(scanf("%d %d",&n,&m) != EOF){
if( n > m) swap(n,m);
double s = (sqrt(5) + 1) /2;
int t = floor( (m-n) * s );
if(t == n) printf("0\n");
else printf("1\n");
}
return 0;
}
本文介绍了一种经典的博弈论问题——威佐夫博弈,并通过POJ.1067题目进行实例分析。文章提供了简洁的算法实现思路,利用黄金分割比例计算优势策略,帮助读者快速理解并掌握威佐夫博弈的解决方法。
3072

被折叠的 条评论
为什么被折叠?



