結果

問題 No.1164 GCD Products hard
ユーザー Navier_Boltzmann
提出日時 2022-07-05 07:58:34
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 431 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 81,868 KB
実行使用メモリ 205,024 KB
最終ジャッジ日時 2024-12-15 08:53:32
合計ジャッジ時間 84,420 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 WA * 4 TLE * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys
input = sys.stdin.readline

A,B,N = map(int,input().split())
mod = 10**9 + 7

cnt = [0]*(B+1)
for i in range(B,1,-1):
    cnt[i] += pow(B//i - (A-1)//i,N,mod)
    for j in range(i+i,B+1,i):
        cnt[i] -= cnt[j]
        cnt[i] %= (mod-1)
ans = 1
for i in range(1,B+1):
    ans *= pow(i,cnt[i],mod)
    ans %= mod
print(ans)
0