結果

問題 No.2576 LCM Pattern
ユーザー 👑 hitonanodehitonanode
提出日時 2023-12-04 00:33:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 616 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 57,556 KB
最終ジャッジ日時 2023-12-04 00:33:43
合計ジャッジ時間 2,650 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
57,556 KB
testcase_01 AC 59 ms
57,556 KB
testcase_02 AC 55 ms
57,556 KB
testcase_03 AC 56 ms
57,556 KB
testcase_04 AC 51 ms
57,556 KB
testcase_05 AC 55 ms
57,556 KB
testcase_06 AC 56 ms
57,556 KB
testcase_07 AC 52 ms
57,556 KB
testcase_08 AC 56 ms
57,556 KB
testcase_09 AC 57 ms
57,556 KB
testcase_10 AC 57 ms
57,556 KB
testcase_11 AC 57 ms
57,556 KB
testcase_12 AC 56 ms
57,556 KB
testcase_13 AC 56 ms
57,556 KB
testcase_14 AC 56 ms
57,556 KB
testcase_15 AC 52 ms
57,556 KB
testcase_16 AC 56 ms
57,556 KB
testcase_17 AC 56 ms
57,556 KB
testcase_18 AC 54 ms
57,556 KB
testcase_19 AC 56 ms
57,556 KB
testcase_20 AC 56 ms
57,556 KB
testcase_21 AC 56 ms
57,556 KB
testcase_22 AC 57 ms
57,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())

ret = 1
md = 998244353

for p in range(2, 1000000):
    d = 0
    while M % p == 0:
        M //= p
        d += 1

    if d:
        ret = ret * (pow(d + 1, N, md) - pow(d, N, md)) % md

if M > 1:
    ret = ret * (pow(2, N, md) - 1) % md

print(ret)
0