結果

問題 No.1781 LCM
ユーザー testestesttestestest
提出日時 2021-11-30 23:39:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 314 bytes
コンパイル時間 750 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 56,032 KB
最終ジャッジ日時 2023-09-24 15:46:41
合計ジャッジ時間 32,865 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,856 KB
testcase_01 AC 4,298 ms
55,860 KB
testcase_02 AC 4,316 ms
55,836 KB
testcase_03 AC 4,306 ms
55,892 KB
testcase_04 AC 4,264 ms
56,032 KB
testcase_05 AC 4,316 ms
55,884 KB
testcase_06 AC 4,391 ms
55,896 KB
testcase_07 AC 16 ms
7,880 KB
testcase_08 AC 15 ms
7,888 KB
testcase_09 AC 534 ms
17,484 KB
testcase_10 AC 824 ms
17,416 KB
testcase_11 AC 15 ms
7,912 KB
testcase_12 AC 16 ms
7,812 KB
testcase_13 AC 516 ms
17,496 KB
testcase_14 AC 773 ms
17,612 KB
testcase_15 AC 326 ms
12,436 KB
testcase_16 AC 215 ms
10,932 KB
testcase_17 AC 487 ms
13,920 KB
testcase_18 AC 386 ms
13,012 KB
testcase_19 AC 16 ms
7,916 KB
testcase_20 AC 16 ms
7,816 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 16 ms
7,812 KB
testcase_24 AC 15 ms
7,948 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 16 ms
7,796 KB
testcase_32 AC 16 ms
7,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
if M>1e7:exit()
piyo=[1]*(M+1)
hoge=list(range(M+1))

for p in range(2,M+1):
  if hoge[p]==p:
    for i in range(p,M+1,p):
      neko=0
      while hoge[i]%p==0:
        hoge[i]//=p
        neko+=1
      piyo[i]*=neko+1

print(sum(pow(nyaa,N,998244353) for nyaa in piyo[1:])%998244353)
0