chore(i18n,curriculum): update translations (#44255)

This commit is contained in:
camperbot
2021-11-23 11:06:14 -08:00
committed by GitHub
parent da3bc930ff
commit ccfe21afb5
62 changed files with 728 additions and 572 deletions

View File

@ -1,6 +1,6 @@
---
id: 5900f3df1000cf542c50fef1
title: 'Problem 115: Counting block combinations II'
title: '问题 115计数块组合 II'
challengeType: 5
forumTopicId: 301741
dashedName: problem-115-counting-block-combinations-ii
@ -8,23 +8,23 @@ dashedName: problem-115-counting-block-combinations-ii
# --description--
A row measuring `n` units in length has red blocks with a minimum length of `m` units placed on it, such that any two red blocks (which are allowed to be different lengths) are separated by at least one black square.
一排长度为 `n` 个单位的行上放置了最小长度为 `m` 个单位的红色块,这样任何两个红色块(允许长度不同)至少被一个黑色方块隔开。
Let the fill-count function, $F(m, n)$, represent the number of ways that a row can be filled.
让填充计数函数,$F(m, n)$,表示可以填充的行数。
For example, $F(3, 29) = 673135$ and $F(3, 30) = 1089155$.
例如, $F(3, 29) = 673135$$F(3, 30) = 1089155$
That is, for m = 3, it can be seen that n = 30 is the smallest value for which the fill-count function first exceeds one million.
就是说,对于 m = 3可以看出 n = 30 是函数结果超过 100 万的最小 n 值。
In the same way, for m = 10, it can be verified that $F(10, 56) = 880711$ and $F(10, 57) = 1148904$, so n = 57 is the least value for which the fill-count function first exceeds one million.
同样,对于 m = 10可以验证 $F(10, 56) = 880711$ $F(10, 57) = 1148904$。即函数第一次超过 100 万的 n 最小值为 57。
For m = 50, find the least value of `n` for which the fill-count function first exceeds one million.
对于 m = 50,找到最小值 `n` 的值,让函数第一次超过 100 万。
**Note:** This is a more difficult version of Problem 114.
**注意:** 这是问题 114 的一个困难版本。
# --hints--
`countingBlockTwo()` should return `168`.
`countingBlockTwo()` 应该返回 `168`
```js
assert.strictEqual(countingBlockTwo(), 168);

View File

@ -1,6 +1,6 @@
---
id: 5900f3e41000cf542c50fef7
title: 'Problem 120: Square remainders'
title: '问题 120平方余数'
challengeType: 5
forumTopicId: 301747
dashedName: problem-120-square-remainders
@ -8,15 +8,15 @@ dashedName: problem-120-square-remainders
# --description--
Let `r` be the remainder when ${(a 1)}^n + {(a + 1)}^n$ is divided by $a^2$.
`r` 记为当 ${(a 1)}^n + {(a + 1)}^n$ 除以 $a^2$ 的余数。
For example, if $a = 7$ and $n = 3$, then $r = 42: 6^3 + 8^3 = 728 ≡ 42 \\ \text{mod}\\ 49$. And as `n` varies, so too will `r`, but for $a = 7$ it turns out that $r_{max} = 42$.
例如,如果 $a = 7$ $n = 3$,则 $r = 42: 6^3 + 8^3 = 728 ≡ 42 \\ \text{mod}\\ 49$ `r` 会随着 `n` 的变化而变化,但对于 $a = 7$,会有 $r_{max} = 42$
For $3 ≤ a ≤ 1000$, find $\sum{r}_{max}$.
对于 $3 ≤ a ≤ 1000$,求 $\sum{r}_{max}$
# --hints--
`squareRemainders()` should return `333082500`.
`squareRemainders()` 应该返回 `333082500`
```js
assert.strictEqual(squareRemainders(), 333082500);

View File

@ -1,6 +1,6 @@
---
id: 5900f3e71000cf542c50fefa
title: 'Problem 123: Prime square remainders'
title: '问题 123素数平方余数'
challengeType: 5
forumTopicId: 301750
dashedName: problem-123-prime-square-remainders
@ -8,20 +8,20 @@ dashedName: problem-123-prime-square-remainders
# --description--
Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn1)n + (pn+1)n is divided by pn2.
令 $p_n$ 为第 $n$ 个素数2, 3, 5, 7, 11, ...,并令 $r$ 为当 ${(p_n1)}^n + {(p_n+ 1)}^n$ 除以 ${p_n}^2$ 的余数。
For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25.
例如,当 $n = 3, p_3 = 5$$4^3 + 6^3 = 280 ≡ 5\\ mod\\ 25$。
The least value of n for which the remainder first exceeds 109 is 7037.
余数超过 $10^9$ 的 $n$ 的最小值是 7037
Find the least value of n for which the remainder first exceeds 1010.
求余数超过 $10^{10}$ 时的 $n$ 的最小值。
# --hints--
`euler123()` should return 21035.
`primeSquareRemainders()` 应该返回 `21035`
```js
assert.strictEqual(euler123(), 21035);
assert.strictEqual(primeSquareRemainders(), 21035);
```
# --seed--
@ -29,12 +29,12 @@ assert.strictEqual(euler123(), 21035);
## --seed-contents--
```js
function euler123() {
function primeSquareRemainders() {
return true;
}
euler123();
primeSquareRemainders();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3fa1000cf542c50ff0c
title: 'Problem 140: Modified Fibonacci golden nuggets'
title: '问题 140改进的斐波那契金块'
challengeType: 5
forumTopicId: 301769
dashedName: problem-140-modified-fibonacci-golden-nuggets
@ -8,22 +8,28 @@ dashedName: problem-140-modified-fibonacci-golden-nuggets
# --description--
Consider the infinite polynomial series AG(x) = xG1 + x2G2 + x3G3 + ..., where Gk is the kth term of the second order recurrence relation Gk = Gk1 + Gk2, G1 = 1 and G2 = 4; that is, 1, 4, 5, 9, 14, 23, ... .
考虑无穷级数 $A_G(x) = xG_1 + x^2G_2 + x^3G_3 + \cdots$,其中 $G_k$ 是二阶递归关系的第 $k$ 项,$G_k = G_{k 1} + G_{k 2}, G_1 = 1$,且 $G_2 = 4$;该数列为 $1, 4, 5, 9, 14, 23, \ldots$。
For this problem we shall be concerned with values of x for which AG(x) is a positive integer.
在这个问题中,我们关注的是那些使得 $A_G(x)$ 为正整数的 $x$ 的值。
The corresponding values of x for the first five natural numbers are shown below.
前五个对应的自然数 $x$ 如下。
xAG(x) (√51)/41 2/52 (√222)/63 (√1375)/144 1/25
| $x$ | $A_G(x)$ |
| ----------------------------- | -------- |
| $\frac{\sqrt{5} 1}{4}$ | $1$ |
| $\frac{2}{5}$ | $2$ |
| $\frac{\sqrt{22} 2}{6}$ | $3$ |
| $\frac{\sqrt{137} 5}{14}$ | $4$ |
| $\frac{1}{2}$ | $5$ |
We shall call AG(x) a golden nugget if x is rational, because they become increasingly rarer; for example, the 20th golden nugget is 211345365. Find the sum of the first thirty golden nuggets.
当 $x$ 是有理数时,我们称 $A_G(x)$ 是一个金砖,因为这样的数字逐渐变得稀少;例如,第 20 个金砖是 211345365。 请计算出前三十个金砖之和。
# --hints--
`euler140()` should return 5673835352990.
`modifiedGoldenNuggets()` 应该返回 `5673835352990`
```js
assert.strictEqual(euler140(), 5673835352990);
assert.strictEqual(modifiedGoldenNuggets(), 5673835352990);
```
# --seed--
@ -31,12 +37,12 @@ assert.strictEqual(euler140(), 5673835352990);
## --seed-contents--
```js
function euler140() {
function modifiedGoldenNuggets() {
return true;
}
euler140();
modifiedGoldenNuggets();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3fc1000cf542c50ff0e
title: 'Problem 143: Investigating the Torricelli point of a triangle'
title: '问题 143三角形托里拆利点的研究'
challengeType: 5
forumTopicId: 301772
dashedName: problem-143-investigating-the-torricelli-point-of-a-triangle
@ -8,20 +8,22 @@ dashedName: problem-143-investigating-the-torricelli-point-of-a-triangle
# --description--
Let ABC be a triangle with all interior angles being less than 120 degrees. Let X be any point inside the triangle and let XA = p, XC = q, and XB = r.
设三角形 ABC 的内角均小于120度。 取三角形内任意一点 X令 $XA = p$$XC = q$$XB = r$。
Fermat challenged Torricelli to find the position of X such that p + q + r was minimised.
费马曾经向托里拆利提出挑战:找到令 p + q + r 最小的点 X 的位置。
Torricelli was able to prove that if equilateral triangles AOB, BNC and AMC are constructed on each side of triangle ABC, the circumscribed circles of AOB, BNC, and AMC will intersect at a single point, T, inside the triangle. Moreover he proved that T, called the Torricelli/Fermat point, minimises p + q + r. Even more remarkable, it can be shown that when the sum is minimised, AN = BM = CO = p + q + r and that AN, BM and CO also intersect at T.
托里拆利证明,若对三角形 ABC 三边分别构造等边三角形 AOBBNC AMC,则三角形 AOBBNC 和 AMC 的外接圆相交于三角形 ABC 内的一点 T。 此外,他还证明这个后来被称为托里拆利点或费马点的点 T就是使得 $p + q + r$ 最小的点。 更值得注意的是,当和最小时,满足 $AN = BM = CO = p + q + r$ 且 ANBM CO 也相交于点 T
If the sum is minimised and a, b, c, p, q and r are all positive integers we shall call triangle ABC a Torricelli triangle. For example, a = 399, b = 455, c = 511 is an example of a Torricelli triangle, with p + q + r = 784. Find the sum of all distinct values of p + q + r ≤ 120000 for Torricelli triangles.
<img class="img-responsive center-block" alt="等边三角形 AOB、BNC 和 AMC 由三角形 ABC 的三边构成,且三角形 AOB、BNC 和 AMC 的外接圆相交于三角形 ABC 内的一点 T。" src="https://cdn.freecodecamp.org/curriculum/project-euler/investigating-the-torricelli-point-of-a-triangle.png" style="background-color: white; padding: 10px;" />
如果当和最小时且有 a、b、c、p、q 和 r 均为正整数,我们就称三角形 ABC 为托里拆利三角形。 例如,$a = 399$、$b = 455$、$c = 511$ 就是一个托里拆利三角形,此时 $p + q + r = 784$。 对于所有满足 $p + q + r ≤ 120000$ 的托里拆利三角形,求出所有不同值的总和。
# --hints--
`euler143()` should return 30758397.
`sumTorricelliTriangles()` 应该返回 `30758397`
```js
assert.strictEqual(euler143(), 30758397);
assert.strictEqual(sumTorricelliTriangles(), 30758397);
```
# --seed--
@ -29,12 +31,12 @@ assert.strictEqual(euler143(), 30758397);
## --seed-contents--
```js
function euler143() {
function sumTorricelliTriangles() {
return true;
}
euler143();
sumTorricelliTriangles();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f3fe1000cf542c50ff11
title: 'Problem 146: Investigating a Prime Pattern'
title: '问题 146素数模式的研究'
challengeType: 5
forumTopicId: 301775
dashedName: problem-146-investigating-a-prime-pattern
@ -8,16 +8,16 @@ dashedName: problem-146-investigating-a-prime-pattern
# --description--
The smallest positive integer n for which the numbers n2+1, n2+3, n2+7, n2+9, n2+13, and n2+27 are consecutive primes is 10. The sum of all such integers n below one-million is 1242490.
使得数字 $n^2 + 1$、$n^2 + 3$、$n^2 + 7$、$n^2 + 9$、$n^2 + 13$ 及 $n^2 + 27$ 为连续素数的最小正整数 $n$ 是 10。 在小于一百万的整数中,所有满足该条件的整数 $n$ 之和为 1242490
What is the sum of all such integers n below 150 million?
请求出在小于一亿五千万的整数中,所有满足该条件的整数 $n$ 之和是多少?
# --hints--
`euler146()` should return 676333270.
`primePattern()` 应该返回 `676333270`
```js
assert.strictEqual(euler146(), 676333270);
assert.strictEqual(primePattern(), 676333270);
```
# --seed--
@ -25,12 +25,12 @@ assert.strictEqual(euler146(), 676333270);
## --seed-contents--
```js
function euler146() {
function primePattern() {
return true;
}
euler146();
primePattern();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4021000cf542c50ff14
title: 'Problem 148: Exploring Pascal''s triangle'
title: '问题 148帕斯卡三角形的研究'
challengeType: 5
forumTopicId: 301777
dashedName: problem-148-exploring-pascals-triangle
@ -8,9 +8,9 @@ dashedName: problem-148-exploring-pascals-triangle
# --description--
We can easily verify that none of the entries in the first seven rows of Pascal's triangle are divisible by 7:
可以轻易证明,帕斯卡三角形前七行中,没有一个数字可以被 7 整除。
<pre>
```
1
1 1
1 2 1
@ -18,20 +18,20 @@ We can easily verify that none of the entries in the first seven rows of Pascal'
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
</pre>
```
However, if we check the first one hundred rows, we will find that only 2361 of the 5050 entries are not divisible by 7.
但是如果我们检查前一百行,会发现在 5050 个数中只有 2361 个数字不能被 7 整除。
# --instructions--
Find the number of entries which are not divisible by 7 in the first one billion (10<sup>9</sup>) rows of Pascal's triangle.
请找出帕斯卡三角形前十亿(${10}^9$)行中不能被 7 整除的数的个数。
# --hints--
`euler148()` should return 2129970655314432.
`entriesOfPascalsTriangle()` 应该返回 `2129970655314432`
```js
assert.strictEqual(euler148(), 2129970655314432);
assert.strictEqual(entriesOfPascalsTriangle(), 2129970655314432);
```
# --seed--
@ -39,12 +39,12 @@ assert.strictEqual(euler148(), 2129970655314432);
## --seed-contents--
```js
function euler148() {
function entriesOfPascalsTriangle() {
return true;
}
euler148();
entriesOfPascalsTriangle();
```
# --solutions--

View File

@ -1,6 +1,6 @@
---
id: 5900f4021000cf542c50ff13
title: 'Problem 149: Searching for a maximum-sum subsequence'
title: '问题 149搜索最大和子序列'
challengeType: 5
forumTopicId: 301778
dashedName: problem-149-searching-for-a-maximum-sum-subsequence
@ -8,28 +8,30 @@ dashedName: problem-149-searching-for-a-maximum-sum-subsequence
# --description--
Looking at the table below, it is easy to verify that the maximum possible sum of adjacent numbers in any direction (horizontal, vertical, diagonal or anti-diagonal) is 16 (= 8 + 7 + 1).
观察下表,可以轻易验证任意方向(水平、垂直、对角线或反对角线)上相邻数字最大和为 $16 (= 8 + 7 + 1)$。
253296513273184 8
$$\begin{array}{|r|r|r|r|} \hline 2 & 5 & 3 & 2 \\\\ \hline 9 & 6 & 5 & 1 \\\\ \hline 3 & 2 & 7 & 3 \\\\ \hline 1 & 8 & 4 & 8 \\\\ \hline \end{array}$$
Now, let us repeat the search, but on a much larger scale:
现在我们重复一遍搜索过程,但是这次是在一个更大规模的表格中:
First, generate four million pseudo-random numbers using a specific form of what is known as a "Lagged Fibonacci Generator":
首先,使用被称为“滞后斐波那契生成器”的特殊方法,生成四百万个伪随机数:
For 1 ≤ k ≤ 55, sk = \[100003 200003k + 300007k3] (modulo 1000000) 500000. For 56 ≤ k ≤ 4000000, sk = \[sk24 + sk55 + 1000000] (modulo 1000000) 500000.
对于 $1 ≤ k ≤ 55$$s_k = (100003 200003k + 300007{k}^3) \\ (modulo\\ 1000000) 500000$。
Thus, s10 = 393027 and s100 = 86613.
对于 $56 ≤ k ≤ 4000000$$s_k = (s_{k 24} + s_{k 55} + 1000000) \\ (modulo\\ 1000000) 500000$。
The terms of s are then arranged in a 2000×2000 table, using the first 2000 numbers to fill the first row (sequentially), the next 2000 numbers to fill the second row, and so on.
可得,$s_{10} = 393027$$s_{100} = 86613$。
Finally, find the greatest sum of (any number of) adjacent entries in any direction (horizontal, vertical, diagonal or anti-diagonal).
这些数字 $s$ 随后排列在一个 2000 x 2000 的表格中,前 2000 个数字填入第一行(顺序填入),后 2000 个数字填充第二行,依次类推。
最后,请找到任意方向(水平、垂直、对象线或反对角线)上相邻数字(任意数量)的最大和。
# --hints--
`euler149()` should return 52852124.
`maximumSubSequence()` 应该返回 `52852124`
```js
assert.strictEqual(euler149(), 52852124);
assert.strictEqual(maximumSubSequence(), 52852124);
```
# --seed--
@ -37,12 +39,12 @@ assert.strictEqual(euler149(), 52852124);
## --seed-contents--
```js
function euler149() {
function maximumSubSequence() {
return true;
}
euler149();
maximumSubSequence();
```
# --solutions--

View File

@ -8,27 +8,27 @@ dashedName: sha-256
# --description--
The `SHA-2` family is a stronger alternative to `SHA-1`. The main difference between them is the length of the hash. Meaning `SHA-1` provides a shorter code with fewer possibilities for unique combinations. `SHA-2` or `SHA-256` creates a longer and thus more complex hash with more possibilities.
`SHA-2` 家族是比 `SHA-1` 更强大的替代。 两者最主要的不同是散列的长度。 即 `SHA-1` 提供了更短的编码,也意味着组合的唯一性概率更低。 `SHA-2` `SHA-256` 创建了较长的散列,从而增加了唯一性的概率。
# --instructions--
Research implemenation details and write a function that takes a string as the parameter and returns a hash using `SHA-256`
研究实现细节并编写一个函数,该函数以字符串为参数并使用 `SHA-256` 返回哈希值
# --hints--
`SHA256` should be a function.
`SHA256` 应该是一个函数。
```js
assert(typeof SHA256 === 'function');
```
`SHA256("Rosetta code")` should return a string.
`SHA256("Rosetta code")` 应该返回一个字符串。
```js
assert(typeof SHA256('Rosetta code') === 'string');
```
`SHA256("Rosetta code")` should return `"764faf5c61ac315f1497f9dfa542713965b785e5cc2f707d6468d7d1124cdfcf"`.
`SHA256("Rosetta code")` 应该返回 `"764faf5c61ac315f1497f9dfa542713965b785e5cc2f707d6468d7d1124cdfcf"`
```js
assert.equal(
@ -37,7 +37,7 @@ assert.equal(
);
```
`SHA256("SHA-256 Hash")` should return `"bee8c0cabdcf8c7835f40217dd35a8b0dba9134520e633f1c57285f35ca7ee3e"`.
`SHA256("SHA-256 Hash")` 应该返回 `"bee8c0cabdcf8c7835f40217dd35a8b0dba9134520e633f1c57285f35ca7ee3e"`
```js
assert.equal(
@ -46,7 +46,7 @@ assert.equal(
);
```
`SHA256("implementation")` should return `"da31012c40330e7e21538e7dd57503b16e8a0839159e96137090cccc9910b171"`.
`SHA256("implementation")` 应该返回 `"da31012c40330e7e21538e7dd57503b16e8a0839159e96137090cccc9910b171"`
```js
assert.equal(
@ -55,7 +55,7 @@ assert.equal(
);
```
`SHA256("algorithm")` should return `"b1eb2ec8ac9f31ff7918231e67f96e6deda83a9ff33ed2c67443f1df81e5ed14"`.
`SHA256("algorithm")` 应该返回 `"b1eb2ec8ac9f31ff7918231e67f96e6deda83a9ff33ed2c67443f1df81e5ed14"`
```js
assert.equal(
@ -64,7 +64,7 @@ assert.equal(
);
```
`SHA256("language")` should return `"a4ef304ba42a200bafd78b046e0869af9183f6eee5524aead5dcb3a5ab5f8f3f"`.
`SHA256("language")` 应该返回 `"a4ef304ba42a200bafd78b046e0869af9183f6eee5524aead5dcb3a5ab5f8f3f"`
```js
assert.equal(