* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
1.4 KiB
1.4 KiB
id, title, challengeType, videoUrl, dashedName
id | title | challengeType | videoUrl | dashedName |
---|---|---|---|---|
5900f49f1000cf542c50ffb1 | 问题306:纸条游戏 | 5 | problem-306-paper-strip-game |
--description--
以下游戏是组合博弈论的经典示例:
两名玩家从n个白色方块开始,轮流交替进行。 在每个回合中,玩家选择两个连续的白色方块并将其涂成黑色。 第一个无法移动的玩家输了。
如果n = 1,则没有有效的移动,因此第一个玩家会自动失败。 如果n = 2,则只有一招有效,此后第二名玩家输了。 如果n = 3,则有两个有效的举动,但都留下第二个玩家输掉的情况。 如果n = 4,则第一个玩家有3个有效动作;她可以通过绘制两个中间方块来赢得比赛。 如果n = 5,则第一个玩家有四次有效移动(下面以红色显示);但无论她做什么,第二名玩家(蓝色)都会获胜。
因此,对于1≤n≤5,有3个n值,第一位玩家可以对其施加强制胜利。 类似地,对于1≤n≤50,第一个玩家可以强制取胜的n值为40。
对于1≤n≤1 000 000,第一个玩家可以强制赢得多少n值?
--hints--
euler306()
应该返回852938。
assert.strictEqual(euler306(), 852938);
--seed--
--seed-contents--
function euler306() {
return true;
}
euler306();
--solutions--
// solution required