結果

問題 No.2576 LCM Pattern
ユーザー hato336hato336
提出日時 2023-12-04 12:19:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 514 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 59,644 KB
最終ジャッジ日時 2023-12-04 12:19:15
合計ジャッジ時間 2,444 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,716 KB
testcase_01 AC 41 ms
53,716 KB
testcase_02 AC 44 ms
55,868 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 44 ms
59,644 KB
testcase_06 AC 44 ms
59,644 KB
testcase_07 AC 44 ms
59,516 KB
testcase_08 AC 44 ms
59,644 KB
testcase_09 AC 45 ms
59,644 KB
testcase_10 AC 45 ms
59,644 KB
testcase_11 AC 44 ms
59,644 KB
testcase_12 AC 45 ms
59,644 KB
testcase_13 AC 44 ms
59,644 KB
testcase_14 AC 44 ms
59,644 KB
testcase_15 AC 44 ms
59,516 KB
testcase_16 AC 41 ms
53,716 KB
testcase_17 AC 46 ms
59,644 KB
testcase_18 AC 44 ms
59,644 KB
testcase_19 AC 45 ms
59,644 KB
testcase_20 AC 46 ms
59,644 KB
testcase_21 AC 41 ms
55,868 KB
testcase_22 AC 41 ms
53,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
if m == 1:
    print(1)
    exit()
def factorization(n):
    relist = []
    if n == 1:
        relist = 1
    for i in range(2, int(n ** 0.5) + 1): #割る数
        while n % i == 0:
            relist.append(i)
            n /= i
    if n != 1:
        relist.append(int(n))
    return relist    
x = factorization(m)
import collections
y = collections.Counter(x)
mod = 998244353
ans = 1
for i in y:
    z = y[i]
    ans *= pow(z+1,n,mod) - pow(z,n,mod)
    ans %= mod
print(ans)
0