chore(i18n,curriculum): update translations (#43633)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f3c81000cf542c50fedb
|
||||
title: 'Problem 92: Square digit chains'
|
||||
title: '问题 92:平方数链'
|
||||
challengeType: 5
|
||||
forumTopicId: 302209
|
||||
dashedName: problem-92-square-digit-chains
|
||||
@ -8,43 +8,43 @@ dashedName: problem-92-square-digit-chains
|
||||
|
||||
# --description--
|
||||
|
||||
A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before.
|
||||
将一个数字的每一位求平方再相加可以得到一个新的数字,不断重复该过程,直到新的数字出现过为止,可以得到一条数链。
|
||||
|
||||
For example,
|
||||
举个例子:
|
||||
|
||||
$$\begin{align} & 44 → 32 → 13 → 10 → \boldsymbol{1} → \boldsymbol{1}\\\\ & 85 → \boldsymbol{89} → 145 → 42 → 20 → 4 → 16 → 37 → 58 → \boldsymbol{89}\\\\ \end{align}$$
|
||||
|
||||
Therefore any chain that arrives at 1 or 89 will become stuck in an endless loop. What is most amazing is that EVERY starting number will eventually arrive at 1 or 89.
|
||||
可以发现,每条到达 1 或 89 的数链都会陷入循环。 最令人惊讶的是,从任意数字开始,数链最终都会到达 1 或 89。
|
||||
|
||||
How many starting numbers below `limit` will arrive at 89?
|
||||
求出有多少个小于 `limit` 的数字最终会到达 89?
|
||||
|
||||
# --hints--
|
||||
|
||||
`squareDigitChains(100)` should return a number.
|
||||
`squareDigitChains(100)` 应该返回一个数字。
|
||||
|
||||
```js
|
||||
assert(typeof squareDigitChains(100) === 'number');
|
||||
```
|
||||
|
||||
`squareDigitChains(100)` should return `80`.
|
||||
`squareDigitChains(100)` 应该返回 `80`。
|
||||
|
||||
```js
|
||||
assert.strictEqual(squareDigitChains(100), 80);
|
||||
```
|
||||
|
||||
`squareDigitChains(1000)` should return `857`.
|
||||
`squareDigitChains(1000)` 应该返回 `857`。
|
||||
|
||||
```js
|
||||
assert.strictEqual(squareDigitChains(1000), 857);
|
||||
```
|
||||
|
||||
`squareDigitChains(100000)` should return `85623`.
|
||||
`squareDigitChains(100000)` 应该返回 `85623`。
|
||||
|
||||
```js
|
||||
assert.strictEqual(squareDigitChains(100000), 85623);
|
||||
```
|
||||
|
||||
`squareDigitChains(10000000)` should return `8581146`.
|
||||
`squareDigitChains(10000000)` 应该返回 `8581146`。
|
||||
|
||||
```js
|
||||
assert.strictEqual(squareDigitChains(10000000), 8581146);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f3cc1000cf542c50fede
|
||||
title: 'Problem 95: Amicable chains'
|
||||
title: '问题 95:友好的数链'
|
||||
challengeType: 5
|
||||
forumTopicId: 302212
|
||||
dashedName: problem-95-amicable-chains
|
||||
@ -8,45 +8,45 @@ dashedName: problem-95-amicable-chains
|
||||
|
||||
# --description--
|
||||
|
||||
The proper divisors of a number are all the divisors excluding the number itself. For example, the proper divisors of 28 are 1, 2, 4, 7, and 14. As the sum of these divisors is equal to 28, we call it a perfect number.
|
||||
一个数的真因子是除自身以外的其他因子。 例如,28 的真因子是 1、2、4、7 和 14。 由于这些真因子之和等于 28,我们称 28 为完全数,又称完美数或完备数。
|
||||
|
||||
Interestingly the sum of the proper divisors of 220 is 284 and the sum of the proper divisors of 284 is 220, forming a chain of two numbers. For this reason, 220 and 284 are called an amicable pair.
|
||||
有趣的是,220 的真因子之和为 284,而 284 的真因子之和为 220,形成了一条两个数构成的链。 因此,220 和 284 被称为友好数对。
|
||||
|
||||
Perhaps less well known are longer chains. For example, starting with 12496, we form a chain of five numbers:
|
||||
也许更长的链条鲜为人知。 例如,从 12496 开始,可以形成一条五个数字的数链:
|
||||
|
||||
$$ 12496 → 14288 → 15472 → 14536 → 14264 \\,(→ 12496 → \cdots) $$
|
||||
|
||||
Since this chain returns to its starting point, it is called an amicable chain.
|
||||
由于该链返回其起始点,因此称为友好数链。
|
||||
|
||||
Find the smallest member of the longest amicable chain with no element exceeding `limit`.
|
||||
找出最长友好数链中的最小数字,要求该链中的每一个数字均不能超过给定的 `limit`。
|
||||
|
||||
# --hints--
|
||||
|
||||
`amicableChains(300)` should return a number.
|
||||
`amicableChains(300)` 应该返回一个数字。
|
||||
|
||||
```js
|
||||
assert(typeof amicableChains(300) === 'number');
|
||||
```
|
||||
|
||||
`amicableChains(300)` should return `220`.
|
||||
`amicableChains(300)` 应该返回 `220`。
|
||||
|
||||
```js
|
||||
assert.strictEqual(amicableChains(300), 220);
|
||||
```
|
||||
|
||||
`amicableChains(15000)` should return `220`.
|
||||
`amicableChains(15000)` 应该返回 `220`。
|
||||
|
||||
```js
|
||||
assert.strictEqual(amicableChains(15000), 220);
|
||||
```
|
||||
|
||||
`amicableChains(100000)` should return `12496`.
|
||||
`amicableChains(100000)` 应该返回 `12496`。
|
||||
|
||||
```js
|
||||
assert.strictEqual(amicableChains(100000), 12496);
|
||||
```
|
||||
|
||||
`amicableChains(1000000)` should return `14316`.
|
||||
`amicableChains(1000000)` 应该返回 `14316`。
|
||||
|
||||
```js
|
||||
assert.strictEqual(amicableChains(1000000), 14316);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5900f3cc1000cf542c50fedf
|
||||
title: 'Problem 96: Su Doku'
|
||||
title: '问题 96:数独'
|
||||
challengeType: 5
|
||||
forumTopicId: 302213
|
||||
dashedName: problem-96-su-doku
|
||||
@ -8,7 +8,7 @@ dashedName: problem-96-su-doku
|
||||
|
||||
# --description--
|
||||
|
||||
Su Doku (Japanese meaning *number place*) is the name given to a popular puzzle concept. Its origin is unclear, but credit must be attributed to Leonhard Euler who invented a similar, and much more difficult, puzzle idea called Latin Squares. The objective of Su Doku puzzles, however, is to replace the blanks (or zeros) in a 9 by 9 grid in such that each row, column, and 3 by 3 box contains each of the digits 1 to 9. Below is an example of a typical starting puzzle grid and its solution grid.
|
||||
数独(日语含义为*数字位置*)是一个非常流行的解密游戏。 它的起源尚不清楚,但必须归功于莱昂哈德·欧拉(Leonhard Euler),他发明了一种类似的,但更加困难的解密游戏,名叫拉丁方块(Latin Squares)。 数独的目标是用数字替换 9X9 网格中的空白(或零),使得每行,每列和每个 3X3 小网格中都只包含 1 到 9 这 9 个数字。 下面是一个示例,包含一个经典的谜题及其对应解。
|
||||
|
||||
<div style="margin: auto; background-color: white; padding: 10px; width: 80%; text-align: center;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" align="center">
|
||||
@ -100,27 +100,27 @@ Su Doku (Japanese meaning *number place*) is the name given to a popular puzzle
|
||||
</table>
|
||||
</div>
|
||||
|
||||
A well constructed Su Doku puzzle has a unique solution and can be solved by logic, although it may be necessary to employ "guess and test" methods in order to eliminate options (there is much contested opinion over this). The complexity of the search determines the difficulty of the puzzle; the example above is considered easy because it can be solved by straight forward direct deduction.
|
||||
一个构造良好的数独谜题应该只有一个唯一的解,可以通过逻辑解出,虽然可能需要采用“猜测和测试”方法来排除选项(对此有很多争议的意见)。 搜索的复杂性决定了谜题的难度;上面的示例很简单,因此可以通过直接的逻辑推理来解出答案。
|
||||
|
||||
The `puzzlesArr` array contains different Su Doku puzzle strings ranging in difficulty, but all with unique solutions.
|
||||
`puzzlesArr` 数组里有若干个数独谜题字符串,难度不一,但是每个谜题的解都是唯一的。
|
||||
|
||||
By solving all puzzles in `puzzlesArr`, find the sum of the 3-digit numbers found in the top left corner of each solution grid; for example, 483 is the 3-digit number found in the top left corner of the solution grid above.
|
||||
通过解出 `puzzlesArr` 数组中所有谜题,返回所有解左上角三位数字之和;举个例子,483 就是上述例子中左上角的三位数字。
|
||||
|
||||
# --hints--
|
||||
|
||||
`suDoku(testPuzzles1)` should return a number.
|
||||
`suDoku(testPuzzles1)` 应该返回一个数字。
|
||||
|
||||
```js
|
||||
assert(typeof suDoku(_testPuzzles1) === 'number');
|
||||
```
|
||||
|
||||
`suDoku(testPuzzles1)` should return `1190`.
|
||||
`suDoku(testPuzzles1)` 应该返回 `1190`。
|
||||
|
||||
```js
|
||||
assert.strictEqual(suDoku(_testPuzzles1), 1190);
|
||||
```
|
||||
|
||||
`suDoku(testPuzzles2)` should return `24702`.
|
||||
`suDoku(testPuzzles2)` 应该返回 `24702`。
|
||||
|
||||
```js
|
||||
assert.strictEqual(suDoku(_testPuzzles2), 24702);
|
||||
|
Reference in New Issue
Block a user