結果

問題 No.2380 Sylow P-subgroup
ユーザー flygonflygon
提出日時 2023-07-14 21:29:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 548 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 71,612 KB
最終ジャッジ日時 2023-10-14 11:28:00
合計ジャッジ時間 3,258 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
71,268 KB
testcase_01 AC 97 ms
71,352 KB
testcase_02 AC 100 ms
71,372 KB
testcase_03 AC 99 ms
71,500 KB
testcase_04 AC 100 ms
71,436 KB
testcase_05 AC 96 ms
71,344 KB
testcase_06 AC 97 ms
71,356 KB
testcase_07 AC 96 ms
71,544 KB
testcase_08 AC 99 ms
71,468 KB
testcase_09 AC 97 ms
71,276 KB
testcase_10 AC 96 ms
71,492 KB
testcase_11 AC 95 ms
71,276 KB
testcase_12 AC 101 ms
71,612 KB
testcase_13 AC 96 ms
71,400 KB
testcase_14 AC 98 ms
71,440 KB
testcase_15 AC 99 ms
71,500 KB
testcase_16 AC 98 ms
71,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n,p = map(int,input().split())
mod = 998244353

now = p
ans = 0
while now <= n:
    ans += n//now
    now *= p


print(pow(p,ans, mod))
0