博弈
文章平均质量分 76
Interstellar_
这个作者很懒,什么都没留下…
展开
-
HDU 1847 Good Luck in CET-4 Everybody! (SG函数)
Good Luck in CET-4 Everybody! Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9412 Accepted Submission(s): 6089 Problem Description原创 2017-03-15 09:03:11 · 419 阅读 · 0 评论 -
HDU 1848 Fibonacci again and again (博弈,SG函数)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1848 思路:一共三堆石子,每堆石子可以分别看成一个子游戏,和游戏的SG函数值即为分游戏SG函数值得Nim和。 #include #include #include #include using namespace std; const int maxn = 1000 + 10; int s原创 2017-03-15 17:01:28 · 308 阅读 · 0 评论 -
HDU 1517 A Multiplication Game (博弈,SG函数)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1517 题意:一个数最开始是1,两人轮流操作,每次可以将这个数乘以2—9,谁最后得到的数不小于n,谁就胜利。 思路:继续用SG函数的方法,这里因为不确定数组要开多大,所以直接用了map存储。SG(1)为0则必败,否则必胜。 #include #include #include #inclu原创 2017-03-15 18:58:42 · 373 阅读 · 0 评论 -
HDU 1536 S-Nim (SG函数)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1536 题意:有若干堆石子,每次可以从任意一堆石子中取若干颗(数目必须在集合S中),问谁会获胜。 思路:SG函数的应用,具体可看http://blog.csdn.net/zhoufenqin/article/details/7903741 #include #include #includ原创 2017-03-15 19:54:14 · 361 阅读 · 0 评论 -
HDU 5996 dingyeye loves stone
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5996 思路: 首先是对阶梯博弈的阐述...博弈在一列阶梯上进行...每个阶梯上放着自然数个点..两个人进行阶梯博弈...每一步则是将一个集体上的若干个点( >=1 )移到前面去..最后没有点可以移动的人输.. 如这就是一个阶梯博弈的初始状态 2 1 3 2 4 ... 只能把后面转载 2017-07-15 12:44:16 · 220 阅读 · 0 评论