結果

問題 No.1158 GCD Products easy
ユーザー Akijin_007Akijin_007
提出日時 2022-11-04 13:47:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 77,324 KB
最終ジャッジ日時 2023-09-25 17:04:05
合計ジャッジ時間 4,110 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,324 KB
testcase_01 AC 69 ms
71,248 KB
testcase_02 AC 68 ms
71,280 KB
testcase_03 AC 74 ms
71,372 KB
testcase_04 AC 73 ms
71,452 KB
testcase_05 AC 78 ms
76,628 KB
testcase_06 AC 73 ms
71,364 KB
testcase_07 AC 82 ms
76,640 KB
testcase_08 AC 70 ms
71,344 KB
testcase_09 AC 70 ms
71,152 KB
testcase_10 AC 71 ms
71,692 KB
testcase_11 AC 70 ms
71,396 KB
testcase_12 AC 75 ms
76,256 KB
testcase_13 AC 71 ms
71,156 KB
testcase_14 AC 68 ms
71,392 KB
testcase_15 AC 71 ms
71,308 KB
testcase_16 AC 68 ms
71,356 KB
testcase_17 AC 69 ms
71,304 KB
testcase_18 AC 67 ms
71,756 KB
testcase_19 AC 70 ms
71,436 KB
testcase_20 AC 69 ms
71,440 KB
testcase_21 AC 68 ms
71,596 KB
testcase_22 AC 68 ms
71,356 KB
testcase_23 AC 70 ms
71,208 KB
testcase_24 AC 78 ms
76,536 KB
testcase_25 AC 70 ms
71,240 KB
testcase_26 AC 217 ms
77,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

A, B, N = map(int, input().split())

mod = 10 ** 9 + 7

from itertools import product
from math import gcd

ans = 1

l = list(range(A, B+1))
# print(l)

for x in product(l, repeat=N):
    g = x[0]
    for i in range(N):
        g = gcd(g, x[i])
    ans = (ans * g) % mod

print(ans)


0