結果

問題 No.1158 GCD Products easy
ユーザー ああいいああいい
提出日時 2022-03-04 14:56:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 244 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 144,256 KB
最終ジャッジ日時 2023-09-25 14:38:51
合計ジャッジ時間 3,686 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,444 KB
testcase_01 AC 71 ms
71,176 KB
testcase_02 AC 72 ms
71,428 KB
testcase_03 AC 73 ms
71,544 KB
testcase_04 AC 72 ms
71,328 KB
testcase_05 AC 75 ms
75,376 KB
testcase_06 AC 70 ms
71,428 KB
testcase_07 AC 86 ms
78,792 KB
testcase_08 AC 72 ms
71,324 KB
testcase_09 AC 74 ms
71,424 KB
testcase_10 AC 73 ms
71,472 KB
testcase_11 AC 73 ms
71,320 KB
testcase_12 AC 83 ms
76,592 KB
testcase_13 AC 73 ms
71,316 KB
testcase_14 AC 73 ms
71,468 KB
testcase_15 AC 73 ms
71,320 KB
testcase_16 AC 72 ms
71,388 KB
testcase_17 AC 72 ms
71,436 KB
testcase_18 AC 72 ms
71,532 KB
testcase_19 AC 72 ms
71,388 KB
testcase_20 AC 72 ms
71,168 KB
testcase_21 AC 73 ms
71,388 KB
testcase_22 AC 72 ms
71,380 KB
testcase_23 AC 71 ms
71,312 KB
testcase_24 AC 83 ms
77,716 KB
testcase_25 AC 70 ms
71,192 KB
testcase_26 AC 244 ms
144,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

stack = list(range(A,B+1))
def gcd(a,b):
    while True:
        r = a % b
        a = b
        b = r
        if r == 0:return a
P = 10 ** 9 + 7
for _ in range(N-1):
    l = []
    for v in stack:
        for j in range(A,B+1):
            l.append(gcd(v,j))
    stack = l
ans = 1
for v in stack:
    ans = ans * v % P
print(ans)
0