結果

問題 No.2380 Sylow P-subgroup
ユーザー pitPpitP
提出日時 2023-07-14 22:00:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 167 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 71,552 KB
最終ジャッジ日時 2023-10-14 12:09:24
合計ジャッジ時間 2,220 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 61 ms
71,272 KB
testcase_02 AC 60 ms
71,380 KB
testcase_03 AC 61 ms
71,168 KB
testcase_04 AC 64 ms
71,360 KB
testcase_05 AC 66 ms
71,480 KB
testcase_06 AC 61 ms
71,260 KB
testcase_07 AC 63 ms
71,268 KB
testcase_08 AC 62 ms
71,376 KB
testcase_09 AC 60 ms
71,256 KB
testcase_10 AC 62 ms
71,452 KB
testcase_11 AC 63 ms
71,348 KB
testcase_12 AC 63 ms
71,324 KB
testcase_13 WA -
testcase_14 AC 61 ms
71,292 KB
testcase_15 AC 64 ms
71,452 KB
testcase_16 AC 63 ms
71,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
N, P = map(int, input().split())
P_ = P
e = 0
cnt = 0
while N >= P_:
    e += N // P_ * pow(2, cnt)
    P_ = P_ * P_
    cnt += 1
print(pow(P, e, MOD))
0