freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-366-stone-game-iii....

56 lines
1.9 KiB
Markdown
Raw Normal View History

---
id: 5900f4da1000cf542c50ffed
challengeType: 5
title: 'Problem 366: Stone Game III'
videoUrl: ''
localeTitle: 问题366石头游戏III
---
## Description
<section id="description">安东和伯恩哈德两位球员正在参加以下比赛。有一堆n块石头。第一个玩家可以移除任何正数的石头但不是整个堆。此后每个玩家可以移除最多两倍于他的对手在之前移动时所用的石头数量。移除最后一块石头的玩家获胜。 <p>例如n = 5如果第一个玩家获得的不仅仅是一块石头那么下一个玩家将能够获得所有剩余的石头。如果第一个玩家拿走一块石头留下四块石头他的对手也将拿走一块石头留下三块石头。第一个玩家不能拿全部三个因为他最多可以拿2x1 = 2个宝石。所以让我们说他也拿走了一块石头留下了2.第二名球员可以拿下剩下的两块石头并获胜。所以5对于第一个玩家来说是一个失败的位置。对于一些获胜位置第一个玩家可能有多个可能的移动。例如当n = 17时第一个玩家可以移除一个或四个宝石。 </p><p>设Mn是第一个玩家在第一个回合的胜利位置可以获得的最大结石数Mn= 0表示任何其他位置。 </p><p> n≤100的ΣMn为728。 </p><p>找到ΣMn为n≤1018。给你的答案模数108。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler366()</code>应该返回88351299。
testString: 'assert.strictEqual(euler366(), 88351299, "<code>euler366()</code> should return 88351299.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler366() {
// Good luck!
return true;
}
euler366();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>