結果

問題 No.2380 Sylow P-subgroup
ユーザー nikoro256nikoro256
提出日時 2023-07-14 22:39:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 296 bytes
コンパイル時間 2,245 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 71,336 KB
最終ジャッジ日時 2023-10-14 12:55:55
合計ジャッジ時間 3,025 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
70,944 KB
testcase_01 AC 69 ms
71,060 KB
testcase_02 AC 69 ms
71,096 KB
testcase_03 AC 68 ms
71,108 KB
testcase_04 AC 70 ms
71,104 KB
testcase_05 AC 69 ms
71,168 KB
testcase_06 AC 68 ms
71,280 KB
testcase_07 AC 68 ms
71,280 KB
testcase_08 AC 69 ms
71,064 KB
testcase_09 AC 67 ms
71,084 KB
testcase_10 AC 69 ms
71,072 KB
testcase_11 AC 67 ms
71,096 KB
testcase_12 AC 69 ms
71,176 KB
testcase_13 WA -
testcase_14 AC 69 ms
71,104 KB
testcase_15 AC 68 ms
71,088 KB
testcase_16 AC 68 ms
71,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def exp(a,b,p):
    ans,mul,div=1,a,1
    for i in range(70):
        if b//div%2==1:
            ans*=mul
            ans%=p
        mul=mul**2%p
        div*=2
    return ans%p

N,P=map(int,input().split())
ci=0
p=998244353
while N!=0:
    N//=P
    ci+=N
    ci%=p
ans=1
print(exp(P,ci%p,p)%p)
0