随笔分类 -  博弈

 
HDU 1536 & 1944
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1536http://acm.hdu.edu.cn/showproblem.php?pid=1944一样的题题意:先给一个集合,代表可能发生的转移。然后m个询问,可以理解为每次给l堆石子,每堆有hi个,问博弈策略直接... 阅读全文
posted @ 2015-06-10 23:55 LegendaryAC 阅读(169) 评论(0) 推荐(0)
HDU 1538
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1538经典经济学问题,海盗分金分析http://www.guokr.com/article/41423/#include #include using namespace std;int a[15];int mai... 阅读全文
posted @ 2015-06-09 00:11 LegendaryAC 阅读(206) 评论(0) 推荐(1)
HDU 2177
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2177威佐夫博奕,面对奇异局势既bk=ak+k时是必败点,其中bk>=ak,k=bk-ak别的处理和其他博弈相同,注意题目的数据取一堆的时候数据有问题#include #include #include #incl... 阅读全文
posted @ 2015-06-07 10:40 LegendaryAC 阅读(172) 评论(0) 推荐(0)
HDU 2176
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2176nim博弈的模型。要输出先手第一次取的情况,考虑角度是留给对手必败态#include #include using namespace std;int a[200005];int main() { in... 阅读全文
posted @ 2015-06-02 22:43 LegendaryAC 阅读(131) 评论(0) 推荐(0)
HDU 1848
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1848利用计算grundy数组,把一类博弈转化为nim博弈,最后x不为0为先手必胜态#include #include #include #include #include using namespace std ... 阅读全文
posted @ 2014-09-01 01:50 LegendaryAC 阅读(401) 评论(0) 推荐(0)
HDU 1849 Rabbit and Grass
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1849Nim博弈View Code #include <iostream>using namespace std ;int main(){ int n ; while(scanf("%d",&n),n) { int a ; int ans=0 ; while(n--) { scanf("%d",&a) ; ans^=a ; } if(!ans) ... 阅读全文
posted @ 2012-07-26 14:29 LegendaryAC 阅读(168) 评论(0) 推荐(0)
HDU 1847 Good Luck in CET-4 Everybody!
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1847如果j-A[i]是必败态,j就是必胜态,显然0必败,一个dp的过程#include #include #include using namespace std;int A[15], win[1005];int... 阅读全文
posted @ 2012-04-19 15:46 LegendaryAC 阅读(232) 评论(0) 推荐(0)