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

1.6 KiB
Raw Blame History

id, title, challengeType, videoUrl, dashedName
id title challengeType videoUrl dashedName
5900f49a1000cf542c50ffac 问题300蛋白质折叠 5 problem-300-protein-folding

--description--

以一种非常简化的形式我们可以将蛋白质视为由疏水H和极性P元素例如HHPPHHHPHHPH。

对于这个问题蛋白质的方向很重要。例如HPP被认为与PPH不同。因此存在2n个由n个元素组成的不同蛋白质。

当人们自然地遇到这些弦时它们总是以H-H接触点的数量尽可能多的方式折叠因为这在能量上是有利的。 结果H元素倾向于在内部积累而P元素在外部。 天然蛋白质当然会在三个维度上折叠,但我们只会考虑蛋白质在两个维度上的折叠。

下图显示了我们的示例蛋白质可以折叠的两种可能方式H-H接触点用红色圆点显示

左侧的折叠只有六个H-H接触点因此永远不会自然发生。 另一方面右侧的折叠具有9个H-H接触点这对于此琴弦是最佳的。

假设H和P元素同样可能出现在沿着字符串的任何位置那么长度为8的随机蛋白质字符串最优折叠中H-H接触点的平均数量为850/28 = 3.3203125。

在最佳折叠长度为15的随机蛋白质串中H-H接触点的平均数量是多少 要获得准确的结果,请使用尽可能多的小数位给出答案。

--hints--

euler300()应该返回8.0540771484375。

assert.strictEqual(euler300(), 8.0540771484375);

--seed--

--seed-contents--

function euler300() {

  return true;
}

euler300();

--solutions--

// solution required