freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-398-cutting-rope.md

56 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f4fa1000cf542c51000d
challengeType: 5
videoUrl: ''
title: 问题398切割绳索
---
## Description
<section id="description">在长度为n的绳索内放置n-1个点彼此之间的距离为1并且从端点开始。在这些点中我们随机选择m-1个点并在这些点处切断绳索以创建m个段。 <p>设Enm为第二最短段的预期长度。例如E3,2= 2且E8,3= 16/7。注意如果多个段具有相同的最短长度则将第二最短段的长度定义为与最短长度相同。 </p><p>找到E107,100。将您的答案四舍五入到小数点后面的小数点后5位。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler398()</code>应返回2010.59096。
testString: assert.strictEqual(euler398(), 2010.59096);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler398() {
// Good luck!
return true;
}
euler398();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>