2022-01-20 19:30:18 +00:00
|
|
|
---
|
|
|
|
id: 5900f4f11000cf542c510002
|
2022-01-22 15:08:20 +00:00
|
|
|
title: '問題 388: 相異なる線'
|
2022-01-20 19:30:18 +00:00
|
|
|
challengeType: 5
|
|
|
|
forumTopicId: 302052
|
|
|
|
dashedName: problem-388-distinct-lines
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
2022-01-22 15:08:20 +00:00
|
|
|
$0 ≤ a, b, c ≤ N$ を満たすすべての格子点 ($a$, $b$, $c$) について考えます。
|
2022-01-20 19:30:18 +00:00
|
|
|
|
2022-01-22 15:08:20 +00:00
|
|
|
すべての線は、原点 $O(0, 0, 0)$ から他の格子点まで引かれます。 相異なるこのような線の数を $D(N)$ とします。
|
2022-01-20 19:30:18 +00:00
|
|
|
|
2022-01-22 15:08:20 +00:00
|
|
|
$D(1\\,000\\,000) = 831\\,909\\,254\\,469\\,114\\,121$ です。
|
2022-01-20 19:30:18 +00:00
|
|
|
|
2022-01-22 15:08:20 +00:00
|
|
|
$D({10}^{10})$ を求めなさい。 回答は、上位 9 桁に続けて下位 9 桁を示すこと。
|
2022-01-20 19:30:18 +00:00
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
2022-01-22 15:08:20 +00:00
|
|
|
`distinctLines()` は `831907372805130000` を返す必要があります。
|
2022-01-20 19:30:18 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
assert.strictEqual(distinctLines(), 831907372805130000);
|
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
|
|
|
function distinctLines() {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
distinctLines();
|
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|