Files
freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-391-hopping-game.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

49 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f4f31000cf542c510006
title: 问题391跳跃游戏
challengeType: 5
videoUrl: ''
dashedName: problem-391-hopping-game
---
# --description--
当将数字从0写入k到二进制时令sk为1的数。例如以二进制形式写0到5我们有0,1,10,11,100,101。有7个1所以s5 = 7.序列S = {skk≥0}开始{0,1 2,4,5,7,9,12......}。
一个游戏由两个玩家玩。在游戏开始之前选择数字n。计数器c从0开始。每转一圈玩家选择一个从1到n的数字然后用该数字增加c。结果值c必须是S的成员。如果没有更多有效的移动则玩家输掉。
例如设n = 5.c从0开始。玩家1选择4所以c变为0 + 4 = 4.玩家2选择5所以c变为4 + 5 = 9.玩家1选择3所以c变为9 + 3 = 12.等等。请注意c必须始终属于S并且每个玩家最多可以将c增加n。
设Mn是第一个玩家在第一个回合强制获胜时可以选择的最高数字如果没有这样的移动则Mn= 0。例如M2= 2M7= 1且M20= 4。
给定ΣMn3 = 81501≤n≤20。
找ΣMn3表示1≤n≤1000。
# --hints--
`euler391()`应该返回61029882288。
```js
assert.strictEqual(euler391(), 61029882288);
```
# --seed--
## --seed-contents--
```js
function euler391() {
return true;
}
euler391();
```
# --solutions--
```js
// solution required
```