結果

問題 No.1158 GCD Products easy
ユーザー NoaSaberNoaSaber
提出日時 2021-04-06 20:49:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 568 bytes
コンパイル時間 907 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 71,620 KB
最終ジャッジ日時 2023-09-02 12:12:49
合計ジャッジ時間 4,936 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,372 KB
testcase_01 AC 79 ms
71,256 KB
testcase_02 AC 80 ms
71,104 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 80 ms
71,500 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 80 ms
71,204 KB
testcase_09 WA -
testcase_10 AC 82 ms
71,176 KB
testcase_11 AC 80 ms
71,320 KB
testcase_12 WA -
testcase_13 AC 82 ms
71,352 KB
testcase_14 AC 83 ms
71,436 KB
testcase_15 AC 81 ms
71,376 KB
testcase_16 AC 82 ms
71,320 KB
testcase_17 AC 81 ms
71,096 KB
testcase_18 AC 80 ms
71,352 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 83 ms
71,332 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 80 ms
71,108 KB
testcase_26 AC 79 ms
71,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,N=map(int,input().split())
mod=10**9+7
ans=1
cnt=[0]*(B+1)
def make_divisors(n):
    lower_divisors,upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
for i in range(B,A-1,-1):
    if i==1:
        break
    x=B//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