結果
| 問題 | No.1158 GCD Products easy |
| ユーザー |
brthyyjp
|
| 提出日時 | 2021-07-04 18:13:05 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 157 ms / 2,000 ms |
| コード長 | 390 bytes |
| 記録 | |
| コンパイル時間 | 143 ms |
| コンパイル使用メモリ | 85,244 KB |
| 実行使用メモリ | 81,396 KB |
| 最終ジャッジ日時 | 2026-03-22 04:19:02 |
| 合計ジャッジ時間 | 2,042 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
ソースコード
import math
from functools import reduce
def gcd(*numbers):
return reduce(fractions.gcd, numbers)
#return reduce(math.gcd, numbers)
def gcd_list(numbers):
return reduce(math.gcd, numbers)
a, b, n = map(int, input().split())
import itertools
mod = 10**9+7
ans = 1
for p in itertools.product(range(a, b+1), repeat=n):
g = gcd_list(p)
ans *= g
ans %= mod
print(ans)
brthyyjp