結果

問題 No.2576 LCM Pattern
ユーザー titiatitia
提出日時 2023-12-04 02:03:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 505 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,004 KB
最終ジャッジ日時 2023-12-04 02:03:03
合計ジャッジ時間 2,367 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,588 KB
testcase_01 AC 35 ms
53,588 KB
testcase_02 AC 39 ms
59,768 KB
testcase_03 AC 35 ms
53,460 KB
testcase_04 AC 34 ms
53,460 KB
testcase_05 AC 46 ms
60,024 KB
testcase_06 AC 43 ms
60,024 KB
testcase_07 AC 38 ms
57,428 KB
testcase_08 AC 44 ms
60,024 KB
testcase_09 AC 40 ms
59,512 KB
testcase_10 WA -
testcase_11 AC 45 ms
62,116 KB
testcase_12 AC 77 ms
76,004 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 37 ms
57,428 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 37 ms
57,428 KB
testcase_19 WA -
testcase_20 AC 38 ms
57,428 KB
testcase_21 WA -
testcase_22 AC 35 ms
53,588 KB
権限があれば一括ダウンロードができます

ソースコード

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