結果

問題 No.2380 Sylow P-subgroup
ユーザー tassei903tassei903
提出日時 2023-07-14 21:31:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 724 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 71,544 KB
最終ジャッジ日時 2023-10-14 11:29:41
合計ジャッジ時間 2,501 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,220 KB
testcase_01 AC 67 ms
71,412 KB
testcase_02 AC 66 ms
71,252 KB
testcase_03 AC 67 ms
71,544 KB
testcase_04 AC 67 ms
71,256 KB
testcase_05 AC 67 ms
71,484 KB
testcase_06 AC 66 ms
71,380 KB
testcase_07 AC 67 ms
71,212 KB
testcase_08 AC 67 ms
71,352 KB
testcase_09 AC 67 ms
71,300 KB
testcase_10 AC 67 ms
71,268 KB
testcase_11 AC 66 ms
71,324 KB
testcase_12 AC 67 ms
71,196 KB
testcase_13 AC 67 ms
71,052 KB
testcase_14 AC 66 ms
71,048 KB
testcase_15 AC 66 ms
71,148 KB
testcase_16 AC 68 ms
71,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
n,p = na()
ans = 0
q = p
while q <= n:
    ans += n//q
    q *= p

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