* 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>
47 lines
1.6 KiB
Markdown
47 lines
1.6 KiB
Markdown
---
|
||
id: 5900f4da1000cf542c50ffed
|
||
title: 问题366:石头游戏III
|
||
challengeType: 5
|
||
videoUrl: ''
|
||
dashedName: problem-366-stone-game-iii
|
||
---
|
||
|
||
# --description--
|
||
|
||
安东和伯恩哈德两位球员正在参加以下比赛。有一堆n块石头。第一个玩家可以移除任何正数的石头,但不是整个堆。此后,每个玩家可以移除最多两倍于他的对手在之前移动时所用的石头数量。移除最后一块石头的玩家获胜。
|
||
|
||
例如,n = 5如果第一个玩家获得的不仅仅是一块石头,那么下一个玩家将能够获得所有剩余的石头。如果第一个玩家拿走一块石头,留下四块石头,他的对手也将拿走一块石头,留下三块石头。第一个玩家不能拿全部三个,因为他最多可以拿2x1 = 2个宝石。所以让我们说他也拿走了一块石头,留下了2.第二名球员可以拿下剩下的两块石头并获胜。所以5对于第一个玩家来说是一个失败的位置。对于一些获胜位置,第一个玩家可能有多个可能的移动。例如,当n = 17时,第一个玩家可以移除一个或四个宝石。
|
||
|
||
设M(n)是第一个玩家在第一个回合的胜利位置可以获得的最大结石数,M(n)= 0表示任何其他位置。
|
||
|
||
n≤100的ΣM(n)为728。
|
||
|
||
找到ΣM(n)为n≤1018。给你的答案模数108。
|
||
|
||
# --hints--
|
||
|
||
`euler366()`应该返回88351299。
|
||
|
||
```js
|
||
assert.strictEqual(euler366(), 88351299);
|
||
```
|
||
|
||
# --seed--
|
||
|
||
## --seed-contents--
|
||
|
||
```js
|
||
function euler366() {
|
||
|
||
return true;
|
||
}
|
||
|
||
euler366();
|
||
```
|
||
|
||
# --solutions--
|
||
|
||
```js
|
||
// solution required
|
||
```
|