上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 25 下一页

2011年8月20日

HDU 1850 Being a Good Boy in Spring Festival

摘要: 这是一道简单的Nim游戏组合博弈问题,对于Nim游戏的某个位置(x1,x2,x3...),当且仅当他们的部分nim和等于0(即各个值的异或),则当前位于P点,所以对于第一步,只要有一个xi大于其余元素的异或值,则xi可以改变成为其余元素的异或值(因为是大于),则这就是一种可能的选择View Code 1 /* 2 * Author:lonelycatcher 3 * problem:HDU 1850 Being a Good Boy in Spring Festival 4 * Type:博弈 5 */ 6 #include <iostream> 7 #include<std 阅读全文

posted @ 2011-08-20 11:29 lonelycatcher 阅读(195) 评论(0) 推荐(0) 编辑

2011年8月19日

HDU 2147 kiki's game 博弈

摘要: 一道很简单的博弈题,找出P状态和N状态的规律即可View Code /* * Author:lonelycatcher * Problem:HDU 2147 * Type:组合博弈 */#include <iostream>#include<stdio.h>#include<cstdlib>using namespace std;int n,m;int main(){ while(scanf("%d %d",&n,&m)) { if(n==0&&m==0)break; if(!(n&1)) { pr 阅读全文

posted @ 2011-08-19 21:48 lonelycatcher 阅读(198) 评论(0) 推荐(0) 编辑

HDU 1847 cet-4 组合博弈

摘要: 这道题也是一道简单的组合博弈题,状态图0 1 2 3 4 5 6 7 8 9.........P N N p N N p N N P........可以看出,所有3的倍数都是P状态的。。。View Code /* * Author:lonelycatcher * Problem:HDU 1847 * Type:简单组合博弈 */#include <iostream>#include<string.h>#include<string>#include<stdio.h>#include<cstdlib>using namespace st 阅读全文

posted @ 2011-08-19 20:22 lonelycatcher 阅读(219) 评论(0) 推荐(0) 编辑

HDU 1846 Brave Game 公平组合博弈

摘要: 最近学了组合博弈的内容挺有意思的,小时牛刀,AC,(*^__^*) 嘻嘻……0是P状态,从1~M是N状态(至少有一种方法可以进入P状态),m+1是p状态(只能进入N状态)。。。。推理可知,m+1的倍数都是P 状态方法一,简单推理:View Code /* * Author:lonelycatcher * Problem:hdu 1846 * Type:博弈 */#include <iostream>#include<stdio.h>#include<string.h>#include<stdlib.h>using namespace std;in 阅读全文

posted @ 2011-08-19 14:41 lonelycatcher 阅读(266) 评论(0) 推荐(0) 编辑

Game theory初步

摘要: 转自:http://www.cnblogs.com/Knuth/archive/2009/09/05/1561002.html游戏1l 有两个游戏者:A和B。l 有21颗石子。l 两人轮流取走石子,每次可取1、2或3颗。l A先取。l 取走最后一颗石子的人获胜,即没有石子可取的人算输。如果剩下1、2或3颗石子,那么接下来取的人就能获胜;如果剩下4颗,那么无论接下来的人怎么取,都会出现前面这种情况,所以接下来取的人一定会输;如果剩下5、6或7颗石子,那么接下来取的人只要使得剩下4颗石子,他就能获胜。0,4,8,12,……都是下一个取石子者的必败状态。现在有21颗石子,21除以4的余数是1,所以先 阅读全文

posted @ 2011-08-19 11:48 lonelycatcher 阅读(186) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 25 下一页

导航