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(