結果
問題 |
No.1158 GCD Products easy
|
ユーザー |
|
提出日時 | 2024-04-21 20:54:08 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 178 ms / 2,000 ms |
コード長 | 352 bytes |
コンパイル時間 | 352 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 76,672 KB |
最終ジャッジ日時 | 2024-10-13 19:17:23 |
合計ジャッジ時間 | 2,811 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 25 |
ソースコード
from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline A,B,N = map(int,input().split()) ans = 1 mod = 10**9 + 7 ans = 1 for p in product([i for i in range(A,B+1)],repeat=N): p0 = p[0] for pp in p: p0 = math.gcd(pp,p0) ans = (ans*p0)%mod print(ans)