Files
freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-366-stone-game-iii.md
Oliver Eyton-Williams ee1e8abd87 feat(curriculum): restore seed + solution to Chinese (#40683)
* 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>
2021-01-12 19:31:00 -07:00

1.6 KiB
Raw Blame History

id, title, challengeType, videoUrl, dashedName
id title challengeType videoUrl dashedName
5900f4da1000cf542c50ffed 问题366石头游戏III 5 problem-366-stone-game-iii

--description--

安东和伯恩哈德两位球员正在参加以下比赛。有一堆n块石头。第一个玩家可以移除任何正数的石头但不是整个堆。此后每个玩家可以移除最多两倍于他的对手在之前移动时所用的石头数量。移除最后一块石头的玩家获胜。

例如n = 5如果第一个玩家获得的不仅仅是一块石头那么下一个玩家将能够获得所有剩余的石头。如果第一个玩家拿走一块石头留下四块石头他的对手也将拿走一块石头留下三块石头。第一个玩家不能拿全部三个因为他最多可以拿2x1 = 2个宝石。所以让我们说他也拿走了一块石头留下了2.第二名球员可以拿下剩下的两块石头并获胜。所以5对于第一个玩家来说是一个失败的位置。对于一些获胜位置第一个玩家可能有多个可能的移动。例如当n = 17时第一个玩家可以移除一个或四个宝石。

设Mn是第一个玩家在第一个回合的胜利位置可以获得的最大结石数Mn= 0表示任何其他位置。

n≤100的ΣMn为728。

找到ΣMn为n≤1018。给你的答案模数108。

--hints--

euler366()应该返回88351299。

assert.strictEqual(euler366(), 88351299);

--seed--

--seed-contents--

function euler366() {

  return true;
}

euler366();

--solutions--

// solution required