結果

問題 No.2380 Sylow P-subgroup
ユーザー tcltktcltk
提出日時 2023-07-15 01:20:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 235 ms / 2,000 ms
コード長 537 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 86,824 KB
実行使用メモリ 89,504 KB
最終ジャッジ日時 2023-10-14 15:33:48
合計ジャッジ時間 5,795 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 233 ms
89,236 KB
testcase_01 AC 231 ms
89,184 KB
testcase_02 AC 231 ms
89,504 KB
testcase_03 AC 231 ms
89,376 KB
testcase_04 AC 231 ms
89,252 KB
testcase_05 AC 232 ms
89,304 KB
testcase_06 AC 234 ms
89,408 KB
testcase_07 AC 233 ms
89,236 KB
testcase_08 AC 231 ms
89,340 KB
testcase_09 AC 232 ms
89,088 KB
testcase_10 AC 233 ms
89,460 KB
testcase_11 AC 235 ms
89,412 KB
testcase_12 AC 231 ms
89,344 KB
testcase_13 AC 230 ms
89,296 KB
testcase_14 AC 233 ms
89,416 KB
testcase_15 AC 233 ms
89,412 KB
testcase_16 AC 229 ms
89,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq


def input():
    return sys.stdin.readline()[:-1]


# sys.setrecursionlimit(1000000)

# _INPUT = """# paste here...
# """
# sys.stdin = io.StringIO(_INPUT)

INF = 10**10

MOD = 998244353


def solve(N, P):
    ans = 0
    k = 0
    p1 = P
    while p1 <= N:
        k += (N // p1)
        p1 *= P
    return pow(P, k, MOD)


N, P = map(int, input().split())
print(solve(N, P))
0