freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-478-mixtures.md

56 lines
2.4 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: 5900f54c1000cf542c51005e
challengeType: 5
videoUrl: ''
localeTitle: 问题478混合物
---
## Description
<section id="description">让我们考虑三种物质的混合物AB和C.混合物可以用其中AB和C的量的比例来描述abc。例如由比例235描述的混合物含有20A30B和50C。 <p>出于这个问题的目的,我们不能将各个组分与混合物分开。但是,我们可以将不同量的不同混合物组合以形成具有新比例的混合物。 </p><p>例如假设我们有三种比例3023611334的混合物。通过混合10个单位的第一个20个单位的第二个和30个单位的第三个我们得到一个比例659的新混合物因为10·3/5 + 20·3/20 + 30·3/1010·0/5 + 20·6/20 + 30·3/1010·2/5 + 20·11/20 + 30·4/10=181527 =659 </p><p>然而使用相同的三种混合物不可能形成比例321因为B的量总是小于C的量。 </p><p>设n是正整数。假设对于0≤abc≤n和gcdabc= 1的整数abc的每三个我们得到具有比率abc的混合。设Mn为所有这些混合物的集合。 </p><p>例如M2包含具有以下比率的19种混合物{001010011012 0211001011021101111 1212012112220121021 1212221}。 </p><p>令En为Mn的子集数其可以产生具有比率111的混合物即具有相等部分AB和C的混合物。我们可以验证E1 = 103E2= 520447E10mod 118 = 82608406和E500mod 118 = 13801403.求E10 000 000mod 118。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler478()</code>应该返回59510340。
testString: assert.strictEqual(euler478(), 59510340);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler478() {
// Good luck!
return true;
}
euler478();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>