結果

問題 No.2211 Frequency Table of GCD
ユーザー 👑 H20H20
提出日時 2023-02-10 23:03:27
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 351 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 95,888 KB
最終ジャッジ日時 2023-09-22 00:10:40
合計ジャッジ時間 5,972 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
76,388 KB
testcase_01 AC 101 ms
71,512 KB
testcase_02 AC 94 ms
71,704 KB
testcase_03 AC 1,042 ms
79,544 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
import math


N,M = map(int, input().split())
A = list(map(int, input().split()))
mod = 998244353
DP = collections.Counter()
for a in A:
    NDP = collections.Counter()
    for k,v in DP.items():
        gc = math.gcd(k, a)
        NDP[gc]=(NDP[gc]+v)%mod
    NDP[a]+=1
    DP.update(NDP)
for i in range(1,M+1):
    print(DP[i]%mod)
0