結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,492 KB
testcase_01 AC 63 ms
71,364 KB
testcase_02 AC 63 ms
71,284 KB
testcase_03 AC 65 ms
71,252 KB
testcase_04 AC 64 ms
71,292 KB
testcase_05 AC 64 ms
71,320 KB
testcase_06 AC 63 ms
71,492 KB
testcase_07 AC 63 ms
71,208 KB
testcase_08 AC 63 ms
71,440 KB
testcase_09 AC 63 ms
71,312 KB
testcase_10 AC 64 ms
71,168 KB
testcase_11 AC 64 ms
71,320 KB
testcase_12 AC 66 ms
71,284 KB
testcase_13 WA -
testcase_14 AC 67 ms
71,432 KB
testcase_15 AC 64 ms
71,308 KB
testcase_16 AC 65 ms
71,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def resolve():
    import sys

    input = sys.stdin.readline
    MOD = 998244353
    n, p = map(int, input().split())
    ans = 0
    x = p
    while x <= n:
        ans += n // x
        ans %= MOD
        x *= p
    print(pow(p, ans, MOD) % MOD)


if __name__ == "__main__":
    resolve()
0