56 lines
1.9 KiB
Markdown
56 lines
1.9 KiB
Markdown
---
|
||
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>设M(n)是第一个玩家在第一个回合的胜利位置可以获得的最大结石数,M(n)= 0表示任何其他位置。 </p><p> n≤100的ΣM(n)为728。 </p><p>找到ΣM(n)为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>
|