結果

問題 No.1158 GCD Products easy
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2024-04-21 20:54:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 209 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 76,544 KB
最終ジャッジ日時 2024-04-21 20:54:12
合計ジャッジ時間 3,023 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
55,040 KB
testcase_01 AC 52 ms
55,168 KB
testcase_02 AC 53 ms
55,936 KB
testcase_03 AC 52 ms
55,040 KB
testcase_04 AC 52 ms
55,424 KB
testcase_05 AC 63 ms
62,208 KB
testcase_06 AC 53 ms
55,424 KB
testcase_07 AC 69 ms
66,304 KB
testcase_08 AC 53 ms
55,424 KB
testcase_09 AC 53 ms
55,168 KB
testcase_10 AC 54 ms
55,168 KB
testcase_11 AC 62 ms
55,808 KB
testcase_12 AC 63 ms
63,360 KB
testcase_13 AC 53 ms
55,424 KB
testcase_14 AC 53 ms
55,168 KB
testcase_15 AC 53 ms
55,168 KB
testcase_16 AC 53 ms
55,168 KB
testcase_17 AC 52 ms
55,040 KB
testcase_18 AC 53 ms
55,680 KB
testcase_19 AC 54 ms
56,192 KB
testcase_20 AC 53 ms
55,552 KB
testcase_21 AC 53 ms
55,808 KB
testcase_22 AC 53 ms
55,168 KB
testcase_23 AC 53 ms
55,808 KB
testcase_24 AC 62 ms
63,360 KB
testcase_25 AC 53 ms
55,168 KB
testcase_26 AC 209 ms
76,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0