結果

問題 No.2380 Sylow P-subgroup
ユーザー miya145592miya145592
提出日時 2023-07-14 21:43:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 71,560 KB
最終ジャッジ日時 2023-10-14 11:47:10
合計ジャッジ時間 2,552 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,248 KB
testcase_01 AC 67 ms
71,288 KB
testcase_02 AC 65 ms
71,532 KB
testcase_03 AC 67 ms
71,296 KB
testcase_04 AC 65 ms
71,296 KB
testcase_05 AC 67 ms
71,340 KB
testcase_06 AC 66 ms
71,272 KB
testcase_07 AC 66 ms
71,488 KB
testcase_08 AC 66 ms
71,248 KB
testcase_09 AC 66 ms
71,152 KB
testcase_10 AC 66 ms
71,112 KB
testcase_11 AC 66 ms
71,356 KB
testcase_12 AC 66 ms
71,364 KB
testcase_13 WA -
testcase_14 AC 66 ms
71,260 KB
testcase_15 AC 66 ms
71,560 KB
testcase_16 AC 68 ms
71,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

cnt = 0
for i in range(2, N+1):
    st = P**(i-1) - 1
    ed = P**i - 1
    if st>=N:
        break
    ed = min(ed, N)
    cnt += (ed//P - st//P) * (i-1)

ans = pow(P, cnt, MOD)

print(ans)
0