* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2.2 KiB
id, title, challengeType, videoUrl, dashedName
id | title | challengeType | videoUrl | dashedName |
---|---|---|---|---|
5900f54c1000cf542c51005e | 问题478:混合物 | 5 | problem-478-mixtures |
--description--
让我们考虑三种物质的混合物:A,B和C.混合物可以用其中A,B和C的量的比例来描述,即(a:b:c)。例如,由比例(2:3:5)描述的混合物含有20%A,30%B和50%C。
出于这个问题的目的,我们不能将各个组分与混合物分开。但是,我们可以将不同量的不同混合物组合以形成具有新比例的混合物。
例如,假设我们有三种比例(3:0:2),(3:6:11)和(3:3:4)的混合物。通过混合10个单位的第一个,20个单位的第二个和30个单位的第三个,我们得到一个比例(6:5:9)的新混合物,因为:(10·3/5 + 20·3/20 + 30·3/10:10·0/5 + 20·6/20 + 30·3/10:10·2/5 + 20·11/20 + 30·4/10)=(18:15:27) =(6:5:9)
然而,使用相同的三种混合物,不可能形成比例(3:2:1),因为B的量总是小于C的量。
设n是正整数。假设对于0≤a,b,c≤n和gcd(a,b,c)= 1的整数(a,b,c)的每三个,我们得到具有比率(a:b:c)的混合。设M(n)为所有这些混合物的集合。
例如,M(2)包含具有以下比率的19种混合物:{(0:0:1),(0:1:0),(0:1:1),(0:1:2),( 0:2:1),(1:0:0),(1:0:1),(1:0:2),(1:1:0),(1:1:1),(1: 1:2),(1:2:0),(1:2:1),(1:2:2),(2:0:1),(2:1:0),(2:1: 1),(2:1:2),(2:2:1)}。
令E(n)为M(n)的子集数,其可以产生具有比率(1:1:1)的混合物,即具有相等部分A,B和C的混合物。我们可以验证E(1) )= 103,E(2)= 520447,E(10)mod 118 = 82608406和E(500)mod 118 = 13801403.求E(10 000 000)mod 118。
--hints--
euler478()
应该返回59510340。
assert.strictEqual(euler478(), 59510340);
--seed--
--seed-contents--
function euler478() {
return true;
}
euler478();
--solutions--
// solution required