题意:给定两个整数,两个人轮流操作,每次可以用较大数减去较小数的整数倍,当一个数变成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: 1000MS Memory Limit: 65536K Total Submissions: 9023 Accepted: 3691 Description Two players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtracts any positive multiple of the lesser o…
Euclid's Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7942 Accepted: 3227 Description Two players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtracts any positive multiple of the lesser o…