56 lines
1.5 KiB
Markdown
56 lines
1.5 KiB
Markdown
|
---
|
|||
|
id: 5900f3e51000cf542c50fef8
|
|||
|
challengeType: 5
|
|||
|
title: 'Problem 121: Disc game prize fund'
|
|||
|
videoUrl: ''
|
|||
|
localeTitle: 问题121:光盘游戏奖金
|
|||
|
---
|
|||
|
|
|||
|
## Description
|
|||
|
<section id="description">一个包包含一个红色圆盘和一个蓝色圆盘。在有机会的游戏中,玩家随机拍摄光盘并记录其颜色。每次转动后,光盘返回到包中,添加一个额外的红色光盘,随机拍摄另一张光盘。如果玩家在游戏结束时拍摄的红色光盘多于红色光盘,则玩家可以支付1英镑玩游戏并获胜。如果游戏进行了四轮比赛,那么玩家获胜的概率恰好是11/120,因此银行家在这场比赛中应该分配的最高奖金将是10英镑,然后才会产生损失。请注意,任何支付都将是一个整数磅,并且还包括为玩游戏而支付的原始£1,因此在给出的示例中,玩家实际上赢得了9英镑。找到应该分配给单个游戏的最大奖金,其中玩15个回合。 </section>
|
|||
|
|
|||
|
## Instructions
|
|||
|
<section id="instructions">
|
|||
|
</section>
|
|||
|
|
|||
|
## Tests
|
|||
|
<section id='tests'>
|
|||
|
|
|||
|
```yml
|
|||
|
tests:
|
|||
|
- text: <code>euler121()</code>应返回2269。
|
|||
|
testString: 'assert.strictEqual(euler121(), 2269, "<code>euler121()</code> should return 2269.");'
|
|||
|
|
|||
|
```
|
|||
|
|
|||
|
</section>
|
|||
|
|
|||
|
## Challenge Seed
|
|||
|
<section id='challengeSeed'>
|
|||
|
|
|||
|
<div id='js-seed'>
|
|||
|
|
|||
|
```js
|
|||
|
function euler121() {
|
|||
|
// Good luck!
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
euler121();
|
|||
|
|
|||
|
```
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</section>
|
|||
|
|
|||
|
## Solution
|
|||
|
<section id='solution'>
|
|||
|
|
|||
|
```js
|
|||
|
// solution required
|
|||
|
```
|
|||
|
</section>
|