HDU1525 Euclid's Game 博弈 题意 给定两个数字 a, b. 每次只能用 较大的值 减去 较小的值的倍数, 两个人轮流进行操作, 第一个得到 0 的胜利. 分析 对于 a == b 和 a % b == 0 的状态, 则先手一定获胜 对于 a > 2 * b 的情况, 因为, 在 (a, b) 的情况下, 先手为绝对聪明, 若他知道 (a % b, b) 为必败态, 则可以转移到 (a % b, b) , 把这个状态留给对手 若他知道 (a % b, b) 为必胜态, 则可以…
Euclid's Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3174 Accepted Submission(s): 1474 Problem Description Two players, Stan and Ollie, play, starting with two natural numbers. Stan,…
Euclid's Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2074 Accepted Submission(s): 924 Problem Description Two players, Stan and Ollie, play, starting with two natural numbers. Stan,…
题意:给定两个整数,两个人轮流操作,每次可以用较大数减去较小数的整数倍,当一个数变成0时,则结束,问谁会胜. 析:很明显如果 a == b 那么就可以直接结束了,那么如果 a > b我们可以交换两个数,保证 a < b.可以分成两类, (1) b - a < a (2) b - a > a 对于第一类,只能一种拿法,只能是从 b 中拿去 a.对于第二种,如果 b 减去 a 后是必败态,那么当前就是必胜态,如果得到是必胜态,那么当前就是必败态, 我们假设 b - ax < a…
题目描述: Euclid's Game Time Limit: 2 Seconds Memory Limit: 65536 KB Two players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtracts any positive multiple of the lesser of the two numbers from the greater of t…
Euclid's Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1256 Accepted Submission(s): 576 Problem Description Two players, Stan and Ollie, play, starting with two natural numbers. Stan,…
Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2145 Accepted Submission(s): 1622 Problem Description 大学时光是浪漫的,女生是浪漫的,圣诞更是浪漫的,但是Rabbit和Grass这两个大学女生在今年的圣诞节却表现得一点都不浪漫:不去逛商场,不去逛…
Life Winner Bo Problem Description Bo is a "Life Winner".He likes playing chessboard games with his girlfriend G. The size of the chessboard is N×M.The top left corner is numbered(1,1) and the lower right corner is numberd (N,M). For each game…
Euclid's Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9033 Accepted: 3695 Description Two players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtracts any positive multiple of the lesser o…
先转一篇看得比较懂的,以后有时间自己再归纳下 转自:http://blog.csdn.net/logic_nut/article/details/4711489 博弈问题若你想仔细学习博弈论,我强烈推荐加利福尼亚大学的Thomas S. Ferguson教授精心撰写并免费提供的这份教材,它使我受益太多.(如果你的英文水平不足以阅读它,我只能说,恐怕你还没到需要看"博弈论"的时候.)Nim游戏是博弈论中最经典的模型(之一?),它又有着十分简单的规则和无比优美的结论,由这个游戏开始了解博弈…
Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3864 Accepted Submission(s): 2919 Problem Description 大学时光是浪漫的,女生是浪漫的,圣诞更是浪漫的,但是Rabbit和Grass这两个大学女生在今年的圣诞节却表现得一点都不浪漫:不去逛商场,不去逛…