码迷,mamicode.com
首页 > 其他好文 > 详细

ACM三大常用博弈

时间:2015-02-04 16:48:58      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:

尼姆博弈(Nimm Game)


http://baike.baidu.com/link?url=QITS5sNMwXZsoxh5tAwYBsa-_GgUd66Vb4fjreoKkqlXmXSyPEE5qVXfxnq1IGRe4AgTxC6lFwROoKx7hZNwbK

威佐夫博弈(Wythoff Game)


http://baike.baidu.com/link?url=X8KSAgEQ2b86gs6bFxYZpro--y-LrbR5aT6KPuFK5lCeoigV_YaPmaBws2X6HcLwOBelnLfmZIn0LruYreVsZa

poj1067

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
#define p  (sqrt(5.0)+1)/2.0
int main(){
    int a,b;
    while(cin>>a>>b){
        if(a>b){
            swap(a,b);
        }
        int k=b-a;
        if(a==(int)(k*p)){
            cout<<0<<endl;
        }
        else{
            cout<<1<<endl;
        }
    }
    return 0;
}


巴什博弈(Bash Game)


http://baike.baidu.com/link?url=N7FkjhNRf6xSG-lcnZ_ohw-cpr44B2vHMN_GDG6U19aoAfY6S0uiWIQOog0NVApLz4a8FpumItGD3XvcGX0GUq

ACM三大常用博弈

标签:

原文地址:http://blog.csdn.net/my_acm/article/details/43485841

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!