結果
| 問題 | No.1164 GCD Products hard |
| ユーザー |
とりゐ
|
| 提出日時 | 2022-01-14 15:18:24 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 236 bytes |
| 記録 | |
| コンパイル時間 | 293 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 130,048 KB |
| 最終ジャッジ日時 | 2026-05-13 15:46:51 |
| 合計ジャッジ時間 | 8,137 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 2 |
| other | TLE * 1 -- * 26 |
ソースコード
a,b,n=map(int,input().split())
mod=10**9+7
ans=1
cnt=[0]*(b+1)
for i in range(b,0,-1):
tmp=pow(b//i-(a-1)//i,n,mod-1)
for j in range(2*i,b+1,i):
tmp-=cnt[j]
tmp%=mod-1
cnt[i]=tmp
ans*=pow(i,tmp,mod)
ans%=mod
print(ans)
とりゐ