結果

問題 No.1164 GCD Products hard
ユーザー 37zigen37zigen
提出日時 2020-08-20 10:07:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,219 ms / 2,500 ms
コード長 401 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 154,112 KB
最終ジャッジ日時 2024-04-21 04:28:19
合計ジャッジ時間 20,230 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 807 ms
129,736 KB
testcase_01 AC 990 ms
135,732 KB
testcase_02 AC 717 ms
119,972 KB
testcase_03 AC 225 ms
82,304 KB
testcase_04 AC 232 ms
83,968 KB
testcase_05 AC 839 ms
129,016 KB
testcase_06 AC 1,030 ms
140,032 KB
testcase_07 AC 1,038 ms
143,232 KB
testcase_08 AC 983 ms
143,104 KB
testcase_09 AC 718 ms
122,240 KB
testcase_10 AC 229 ms
80,640 KB
testcase_11 AC 790 ms
124,928 KB
testcase_12 AC 1,027 ms
139,356 KB
testcase_13 AC 597 ms
114,336 KB
testcase_14 AC 622 ms
121,472 KB
testcase_15 AC 1,052 ms
144,384 KB
testcase_16 AC 709 ms
125,884 KB
testcase_17 AC 818 ms
127,368 KB
testcase_18 AC 726 ms
122,496 KB
testcase_19 AC 259 ms
85,888 KB
testcase_20 AC 380 ms
96,640 KB
testcase_21 AC 1,110 ms
144,640 KB
testcase_22 AC 39 ms
51,712 KB
testcase_23 AC 1,009 ms
153,856 KB
testcase_24 AC 1,219 ms
154,112 KB
testcase_25 AC 38 ms
51,840 KB
testcase_26 AC 38 ms
52,096 KB
testcase_27 AC 38 ms
51,712 KB
testcase_28 AC 37 ms
51,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

ans=1

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