結果
問題 |
No.1158 GCD Products easy
|
ユーザー |
![]() |
提出日時 | 2023-01-02 02:25:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 175 ms / 2,000 ms |
コード長 | 259 bytes |
コンパイル時間 | 323 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 75,776 KB |
最終ジャッジ日時 | 2024-11-27 00:32:25 |
合計ジャッジ時間 | 2,485 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 25 |
ソースコード
from itertools import * from math import * A, B, N = map(int, input().split()) mod = 10 ** 9 + 7 ans = 1 for tup in product(range(A, B + 1), repeat=N): g = tup[0] for i in range(1, N): g = gcd(g, tup[i]) ans *= g ans %= mod print(ans)