Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* 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>
2021-01-12 19:31:00 -07:00

2.6 KiB
Raw Blame History

id, title, challengeType, videoUrl, dashedName
id title challengeType videoUrl dashedName
5900f4a71000cf542c50ffba 问题315数字根时钟 5 problem-315-digital-root-clocks

--description--

请Sam和Max将两个数字时钟转换为两个“数字根”时钟。

数字根时钟是一种逐步计算数字根的数字时钟。

当时钟输入一个数字时,它将显示它,然后它将开始计算,显示所有中间值,直到得到结果为止。 例如如果时钟被输入数字137它将显示“ 137”→“ 11”→“ 2”然后它将变黑等待下一个数字。

每个数字均由一些亮段组成:三个水平段(顶部,中间,底部)和四个垂直段(左上,右上,左下,右下)。 数字“ 1”由垂直的右上角和右下角构成数字“ 4”由中间的水平和垂直左上角右上角和右下角组成。数字“ 8”将它们全部点亮。

仅当打开/关闭分段时,时钟才消耗能量。 打开“ 2”将花费5个转换而“ 7”将仅花费4个转换。

山姆和麦克斯建造了两个不同的时钟。

山姆的时钟喂食例如数字137时钟显示“ 137”然后关闭面板然后打开下一个数字“ 11”然后再次关闭面板最后打开最后一个数字“ 2”并在一段时间后关闭。 例如对于数字137Sam的时钟要求“ 137” 2 + 5 + 4×2 = 22个转换“ 137”打开/关闭)。 “ 11” 2 + 2×2 = 8个转换“ 11”开/关)。 “ 2” 5×2 = 10个转换“ 2”打开/关闭)。

总共进行了40次转换。

马克斯的时钟工作方式不同。除了关闭整个面板,它还足够聪明,可以仅关闭下一个数字不需要的那些段。 对于数字137麦克斯的时钟要求“ 137” 2 + 5 + 4 = 11个转换“ 137”亮 7个转换关闭数字“ 11”不需要的段。 “ 11” 0个转换数字“ 11”已正确打开 3个转换关闭第一个“ 1”和第二个“ 1”的底部 顶部与数字“ 2”相同。 “ 2” 4个转换打开其余段以获取“ 2” 5个转换关闭数字“ 2”

总共进行了30次转换。

当然Max的时钟比Sam的时钟消耗更少的功率。 两个时钟都馈入A = 107和B = 2×107之间的所有素数。 求出Sam的时钟所需的跃迁总数与Max的时钟所需的跃迁总数之间的差。

--hints--

euler315()应该返回13625242。

assert.strictEqual(euler315(), 13625242);

--seed--

--seed-contents--

function euler315() {

  return true;
}

euler315();

--solutions--

// solution required