結果

問題 No.2380 Sylow P-subgroup
ユーザー komkompi
提出日時 2023-07-15 11:28:47
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 254 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 62,464 KB
最終ジャッジ日時 2024-09-16 19:49:00
合計ジャッジ時間 4,584 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 TLE * 1 -- * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
MOD=998244353

N,P=map(int,input().split())

cands=[P]

while P*cands[-1]<=10**12:
    cands.append(P*cands[-1])

P_num=0

for c in cands:
    P_num+=N//c

ans=1
for i in range(P_num):
    ans*=P
    ans%=MOD

print(ans)
0