結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,360 KB
testcase_01 AC 64 ms
71,240 KB
testcase_02 AC 66 ms
71,360 KB
testcase_03 AC 66 ms
71,308 KB
testcase_04 AC 65 ms
71,460 KB
testcase_05 AC 63 ms
71,216 KB
testcase_06 AC 63 ms
71,268 KB
testcase_07 AC 65 ms
71,432 KB
testcase_08 AC 65 ms
71,264 KB
testcase_09 AC 65 ms
71,284 KB
testcase_10 AC 64 ms
71,600 KB
testcase_11 AC 66 ms
71,236 KB
testcase_12 AC 65 ms
71,336 KB
testcase_13 WA -
testcase_14 AC 66 ms
71,292 KB
testcase_15 AC 65 ms
71,284 KB
testcase_16 AC 64 ms
71,296 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))


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