結果

問題 No.2380 Sylow P-subgroup
ユーザー flygonflygon
提出日時 2023-07-14 21:24:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 373 bytes
コンパイル時間 884 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 71,916 KB
最終ジャッジ日時 2023-10-14 11:21:49
合計ジャッジ時間 3,074 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,740 KB
testcase_01 AC 88 ms
71,740 KB
testcase_02 AC 87 ms
71,812 KB
testcase_03 AC 85 ms
71,640 KB
testcase_04 AC 85 ms
71,716 KB
testcase_05 AC 85 ms
71,532 KB
testcase_06 AC 86 ms
71,556 KB
testcase_07 AC 87 ms
71,916 KB
testcase_08 AC 85 ms
71,624 KB
testcase_09 AC 85 ms
71,672 KB
testcase_10 AC 86 ms
71,556 KB
testcase_11 AC 88 ms
71,676 KB
testcase_12 AC 87 ms
71,524 KB
testcase_13 WA -
testcase_14 AC 87 ms
71,740 KB
testcase_15 AC 92 ms
71,524 KB
testcase_16 AC 92 ms
71,608 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
    ans %= mod

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