freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-382-generating-poly...

56 lines
1.5 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: 5900f4eb1000cf542c50fffd
challengeType: 5
videoUrl: ''
title: 问题382生成多边形
---
## Description
<section id="description">多边形是由直线段组成的扁平形状,所述直线段连接以形成闭合链或电路。多边形由至少三个边组成,并且不自相交。 <p>如果P的两边不是相同的长度P的每一边的长度在S中并且S不包含其他值则称正数的集合S生成多边形P. </p><p>例如:集合{3,4,5}生成边3,4和5三角形的多边形。集合{6,9,11,24}生成具有边6,9,11和24四边形的多边形。集合{1,2,3}和{2,3,4,9}根本不生成任何多边形。 </p><p>考虑序列s定义如下s1 = 1s2 = 2s3 = 3 sn = sn-1 + sn-3n&gt; 3。 </p><p>设Un为集合{s1s2...sn}。例如U10 = {1,2,3,4,6,9,13,19,28,41}。设fn是产生至少一个多边形的Un子集的数量。例如f5= 7f10= 501f25= 18635853。 </p><p>找到f1018的最后9位数。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler382()</code>应该返回697003956。
testString: assert.strictEqual(euler382(), 697003956);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler382() {
// Good luck!
return true;
}
euler382();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>