結果

問題 No.2576 LCM Pattern
ユーザー titia
提出日時 2023-12-04 02:03:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 76,160 KB
最終ジャッジ日時 2024-09-26 22:37:27
合計ジャッジ時間 2,025 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

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

mod=998244353

def fact(x):
    LIST=[]

    for i in range(1,round(x**(1/2))+2):
        if x%i==0:
            LIST.append(i)
            LIST.append(x//i)

    return set(LIST)

ANS=dict()

SA=sorted(fact(M))

for a in SA:
    L=fact(a)

    score=pow(len(L),N,mod)

    for k in L:
        if k==a:
            continue
        score-=ANS[k]

    ANS[a]=score

print(ANS[M])

0