結果

問題 No.1164 GCD Products hard
ユーザー 37zigen37zigen
提出日時 2020-08-20 10:11:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,346 ms / 2,500 ms
コード長 352 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 82,272 KB
実行使用メモリ 154,124 KB
最終ジャッジ日時 2024-04-21 04:34:33
合計ジャッジ時間 22,672 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 912 ms
129,668 KB
testcase_01 AC 1,106 ms
135,488 KB
testcase_02 AC 844 ms
120,144 KB
testcase_03 AC 291 ms
83,828 KB
testcase_04 AC 288 ms
83,904 KB
testcase_05 AC 947 ms
128,944 KB
testcase_06 AC 1,133 ms
139,768 KB
testcase_07 AC 1,095 ms
143,496 KB
testcase_08 AC 1,068 ms
143,100 KB
testcase_09 AC 786 ms
122,044 KB
testcase_10 AC 238 ms
81,380 KB
testcase_11 AC 855 ms
125,252 KB
testcase_12 AC 1,113 ms
139,288 KB
testcase_13 AC 660 ms
114,060 KB
testcase_14 AC 659 ms
121,644 KB
testcase_15 AC 1,189 ms
144,464 KB
testcase_16 AC 810 ms
125,596 KB
testcase_17 AC 947 ms
127,276 KB
testcase_18 AC 837 ms
122,608 KB
testcase_19 AC 295 ms
86,156 KB
testcase_20 AC 441 ms
97,612 KB
testcase_21 AC 1,206 ms
144,696 KB
testcase_22 AC 43 ms
52,688 KB
testcase_23 AC 1,155 ms
154,124 KB
testcase_24 AC 1,346 ms
154,052 KB
testcase_25 AC 47 ms
53,612 KB
testcase_26 AC 42 ms
52,212 KB
testcase_27 AC 43 ms
52,612 KB
testcase_28 AC 42 ms
52,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

isPrime=[True]*(B+1)
for i in range(2,B+1):
    if isPrime[i]:
        for j in range(i*i,B+1,i):
            isPrime[j]=False
MOD=10**9+7

ans=1

for p in range(2,B+1):
    if not isPrime[p]:
        continue
    pe=p
    while pe<=B:
        ans=ans*pow(p,pow(B//pe-(A-1)//pe,N,MOD-1),MOD)%MOD
        pe*=p
print(ans)
0