freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-149-searching-for-a-maximum-sum-subsequence.md
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

53 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f4021000cf542c50ff13
title: 问题149搜索最大和子序列
challengeType: 5
videoUrl: ''
dashedName: problem-149-searching-for-a-maximum-sum-subsequence
---
# --description--
查看下表可以很容易地验证任意方向水平垂直对角或反对角上相邻数字的最大和为16= 8 + 7 + 1
253296513273184 8
现在,让我们重复搜索,但范围更大:
首先,使用称为“滞后斐波那契生成器”的特定形式生成四百万个伪随机数:
对于1≤k≤55sk = \[100003 200003k + 300007k3]模1000000 500000。 对于56≤k≤4000000sk = \[sk-24 + sk-55 + 1000000]模1000000 500000。
因此s10 = -393027s100 = 86613。
然后将s的项排列在2000×2000表中使用前2000个数字顺序填充第一行使用后2000个数字填充第二行依此类推。
最后,在任何方向(水平,垂直,对角线或反对角线)上找到(任意数量)相邻项的最大和。
# --hints--
`euler149()`应该返回52852124。
```js
assert.strictEqual(euler149(), 52852124);
```
# --seed--
## --seed-contents--
```js
function euler149() {
return true;
}
euler149();
```
# --solutions--
```js
// solution required
```