結果

問題 No.1158 GCD Products easy
ユーザー ああいいああいい
提出日時 2022-03-04 14:55:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 990 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 144,628 KB
最終ジャッジ日時 2023-09-25 14:38:46
合計ジャッジ時間 4,623 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,432 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 71 ms
71,152 KB
testcase_09 WA -
testcase_10 AC 76 ms
76,308 KB
testcase_11 AC 71 ms
71,320 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 68 ms
71,172 KB
testcase_15 WA -
testcase_16 AC 68 ms
71,144 KB
testcase_17 AC 68 ms
71,456 KB
testcase_18 AC 69 ms
71,156 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 69 ms
71,452 KB
testcase_23 WA -
testcase_24 AC 82 ms
77,132 KB
testcase_25 AC 75 ms
76,184 KB
testcase_26 AC 237 ms
144,628 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(5):
    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