freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-232-the-race.md

56 lines
1.3 KiB
Markdown
Raw Normal View History

---
id: 5900f4551000cf542c50ff67
challengeType: 5
videoUrl: ''
localeTitle: 问题232比赛
---
## Description
<section id="description">两名玩家分享一个无偏见的硬币并轮流玩“The Race”。在玩家1的回合中他扔了一次硬币如果它出现在Heads他得分为1分;如果它出现Tails他什么都没得分。在玩家2的回合中她选择一个正整数T并将硬币投掷T次如果它出现在所有的头上她得到2T-1分;否则她没有得分。玩家1排在第一位。获胜者是第一个达到100分或更多分。 <p>在每次转弯时玩家2选择硬币投掷的数量T以最大化她获胜的概率。 </p><p>玩家2获胜的概率是多少 </p><p>将您的答案四舍五入到0.abcdefgh形式的八位小数。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler232()</code>应返回0.83648556。
testString: assert.strictEqual(euler232(), 0.83648556);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler232() {
// Good luck!
return true;
}
euler232();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>