結果
問題 | No.2211 Frequency Table of GCD |
ユーザー | 👑 H20 |
提出日時 | 2023-02-10 23:05:27 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 359 bytes |
コンパイル時間 | 284 ms |
コンパイル使用メモリ | 87,088 KB |
実行使用メモリ | 96,840 KB |
最終ジャッジ日時 | 2023-09-22 00:12:24 |
合計ジャッジ時間 | 5,715 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 106 ms
76,488 KB |
testcase_01 | AC | 101 ms
71,844 KB |
testcase_02 | AC | 103 ms
71,844 KB |
testcase_03 | AC | 1,045 ms
79,640 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 | -- | - |
ソースコード
import collections import math N,M = map(int, input().split()) A = list(map(int, input().split())) A.sort() 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)