* 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>
1.5 KiB
1.5 KiB
id, title, challengeType, videoUrl, dashedName
id | title | challengeType | videoUrl | dashedName |
---|---|---|---|---|
5900f4bd1000cf542c50ffcf | 问题336:Maximix安排 | 5 | problem-336-maximix-arrangements |
--description--
一列火车用于按顺序运输四辆车:ABCD。然而,有时当火车到达收集车厢时,它们的顺序不正确。为了重新安排车厢,他们都被分流到一个大型旋转转盘上。在车厢在特定点处脱开之后,列车从转盘上移开,拉动仍与其连接的托架。其余的车厢旋转180度。然后重新加入所有托架,并且根据需要重复该过程,以便获得转盘的最少使用次数。一些布置,例如ADCB,可以很容易地解决:托架在A和D之间分开,并且在DCB旋转之后,已经实现了正确的顺序。
然而,火车司机简单西蒙并不知道他的效率,所以他总是通过最初将马车A放在正确的位置,然后是马车B等来解决问题。
使用四个车厢,西蒙的最坏可能安排是DACB和DBAC,我们称之为maximix安排。每个都需要他五次旋转(尽管使用最有效的方法,他们可以使用三次旋转来解决)。他用于DACB的过程如下所示。
可以证实,对于六个车厢存在24个最大值布置,其中第十个词典最大化布置是DFAECB。
查找11种车厢的第11版词典格式。
--hints--
euler336()
应该返回CAGBIHEFJDK。
assert.strictEqual(euler336(), CAGBIHEFJDK);
--seed--
--seed-contents--
function euler336() {
return true;
}
euler336();
--solutions--
// solution required