2022-01-21 01:00:18 +05:30
|
|
|
---
|
|
|
|
id: 5900f4ae1000cf542c50ffbf
|
2022-01-22 20:38:20 +05:30
|
|
|
title: '問題 320: 巨大な整数で割り切れる階乗'
|
2022-01-21 01:00:18 +05:30
|
|
|
challengeType: 5
|
|
|
|
forumTopicId: 301977
|
|
|
|
dashedName: problem-320-factorials-divisible-by-a-huge-integer
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
$n!$ が $(i!)^{1234567890}$ で割り切れるような最小の整数 $n$ を $N(i)$ とします。
|
2022-01-21 01:00:18 +05:30
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
$10 ≤ i ≤ u$ に対し、$S(u) = \sum N(i)$ と定義します。
|
2022-01-21 01:00:18 +05:30
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
$S(1000)=614\\,538\\,266\\,565\\,663$ です。
|
2022-01-21 01:00:18 +05:30
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
$S(1\\,000\\,000)\bmod {10}^{18}$ を求めなさい。
|
2022-01-21 01:00:18 +05:30
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
`divisibleByHugeInteger()` `278157919195482660` を返す必要があります。
|
2022-01-21 01:00:18 +05:30
|
|
|
|
|
|
|
```js
|
|
|
|
assert.strictEqual(divisibleByHugeInteger(), 278157919195482660);
|
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
|
|
|
function divisibleByHugeInteger() {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
divisibleByHugeInteger();
|
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|