結果

問題 No.2380 Sylow P-subgroup
ユーザー ikomaikoma
提出日時 2023-07-14 22:01:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 222 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 7,956 KB
最終ジャッジ日時 2023-10-14 12:11:23
合計ジャッジ時間 1,240 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,776 KB
testcase_01 AC 14 ms
7,776 KB
testcase_02 AC 14 ms
7,844 KB
testcase_03 AC 14 ms
7,856 KB
testcase_04 AC 14 ms
7,956 KB
testcase_05 AC 14 ms
7,852 KB
testcase_06 AC 14 ms
7,772 KB
testcase_07 AC 14 ms
7,948 KB
testcase_08 AC 14 ms
7,956 KB
testcase_09 AC 14 ms
7,800 KB
testcase_10 AC 14 ms
7,896 KB
testcase_11 AC 14 ms
7,948 KB
testcase_12 AC 15 ms
7,880 KB
testcase_13 WA -
testcase_14 AC 14 ms
7,776 KB
testcase_15 AC 14 ms
7,948 KB
testcase_16 AC 14 ms
7,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD=998244353
N,P=map(int,input().split())

def solve(N,P):
    N//=P
    ans=0
    a=1
    while N:
        ans+=a * (N%P)
        ans%=MOD
        a = a*P+1
        N//=P

    return (pow(P, ans, MOD))

print(solve(N,P))
0