結果

問題 No.1158 GCD Products easy
ユーザー NoaSaberNoaSaber
提出日時 2021-04-06 21:03:08
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 71,724 KB
最終ジャッジ日時 2023-09-02 12:27:51
合計ジャッジ時間 4,032 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,344 KB
testcase_01 AC 76 ms
71,412 KB
testcase_02 AC 80 ms
71,656 KB
testcase_03 AC 75 ms
71,172 KB
testcase_04 AC 78 ms
71,468 KB
testcase_05 AC 78 ms
71,660 KB
testcase_06 AC 76 ms
71,336 KB
testcase_07 AC 79 ms
71,200 KB
testcase_08 AC 77 ms
71,528 KB
testcase_09 AC 78 ms
71,724 KB
testcase_10 AC 77 ms
71,612 KB
testcase_11 AC 76 ms
71,284 KB
testcase_12 AC 76 ms
71,352 KB
testcase_13 AC 78 ms
71,412 KB
testcase_14 AC 79 ms
71,544 KB
testcase_15 AC 78 ms
71,440 KB
testcase_16 AC 79 ms
71,612 KB
testcase_17 AC 77 ms
71,364 KB
testcase_18 AC 76 ms
71,424 KB
testcase_19 AC 76 ms
71,340 KB
testcase_20 AC 76 ms
71,152 KB
testcase_21 AC 77 ms
71,612 KB
testcase_22 AC 79 ms
71,360 KB
testcase_23 AC 79 ms
71,464 KB
testcase_24 AC 79 ms
71,616 KB
testcase_25 AC 79 ms
71,204 KB
testcase_26 AC 78 ms
71,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,N=map(int,input().split())
mod=10**9+7
ans=1
cnt=[0]*(B+1)
for i in range(B,1,-1):
    if i==1:
        break
    x=B//i-(A-1)//i
    cnt[i]=pow(x,N,mod)
    for j in range(i*2,B+1,i):
        cnt[i]-=cnt[j]
for i,j in enumerate(cnt):
    ans*=pow(i,j,mod)
    ans%=mod
print(ans)
0