2021-05-05 10:13:49 -07:00
|
|
|
|
---
|
|
|
|
|
id: 5900f3fa1000cf542c50ff0d
|
2021-10-03 12:24:27 -07:00
|
|
|
|
title: '問題 142:完全平方數合集'
|
2021-05-05 10:13:49 -07:00
|
|
|
|
challengeType: 5
|
|
|
|
|
forumTopicId: 301771
|
|
|
|
|
dashedName: problem-142-perfect-square-collection
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
2021-10-03 12:24:27 -07:00
|
|
|
|
請找出最小的 $x + y + z$,其中整數 $x > y > z > 0$ 需要滿足 $x + y$、$x − y$、$x + z$、$x − z$、$y + z$、$y − z$ 均爲完全平方數。
|
2021-05-05 10:13:49 -07:00
|
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
|
2021-10-03 12:24:27 -07:00
|
|
|
|
`perfectSquareCollection()` 應該返回 `1006193`。
|
2021-05-05 10:13:49 -07:00
|
|
|
|
|
|
|
|
|
```js
|
2021-10-03 12:24:27 -07:00
|
|
|
|
assert.strictEqual(perfectSquareCollection(), 1006193);
|
2021-05-05 10:13:49 -07:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
|
|
```js
|
2021-10-03 12:24:27 -07:00
|
|
|
|
function perfectSquareCollection() {
|
2021-05-05 10:13:49 -07:00
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-03 12:24:27 -07:00
|
|
|
|
perfectSquareCollection();
|
2021-05-05 10:13:49 -07:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|