結果

問題 No.2561 みんな大好きmod 998
ユーザー KudeKude
提出日時 2023-12-12 22:39:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 270 ms / 4,000 ms
コード長 266 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 81,444 KB
実行使用メモリ 252,132 KB
最終ジャッジ日時 2023-12-12 22:39:57
合計ジャッジ時間 6,701 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,204 KB
testcase_01 AC 54 ms
80,192 KB
testcase_02 AC 34 ms
53,204 KB
testcase_03 AC 256 ms
252,124 KB
testcase_04 AC 270 ms
252,108 KB
testcase_05 AC 244 ms
252,132 KB
testcase_06 AC 243 ms
252,108 KB
testcase_07 AC 35 ms
53,204 KB
testcase_08 AC 39 ms
53,204 KB
testcase_09 AC 42 ms
59,636 KB
testcase_10 AC 33 ms
53,204 KB
testcase_11 AC 82 ms
122,968 KB
testcase_12 AC 34 ms
53,204 KB
testcase_13 AC 33 ms
53,204 KB
testcase_14 AC 33 ms
53,204 KB
testcase_15 AC 264 ms
252,128 KB
testcase_16 AC 34 ms
53,204 KB
testcase_17 AC 34 ms
53,204 KB
testcase_18 AC 34 ms
53,204 KB
testcase_19 AC 199 ms
246,136 KB
testcase_20 AC 39 ms
59,636 KB
testcase_21 AC 34 ms
53,204 KB
testcase_22 AC 34 ms
53,204 KB
testcase_23 AC 34 ms
53,204 KB
testcase_24 AC 34 ms
53,204 KB
testcase_25 AC 33 ms
53,204 KB
testcase_26 AC 93 ms
139,096 KB
testcase_27 AC 245 ms
252,124 KB
testcase_28 AC 129 ms
165,788 KB
testcase_29 AC 63 ms
92,780 KB
testcase_30 AC 116 ms
163,688 KB
testcase_31 AC 168 ms
246,136 KB
testcase_32 AC 70 ms
102,800 KB
testcase_33 AC 63 ms
92,780 KB
testcase_34 AC 242 ms
252,108 KB
testcase_35 AC 58 ms
85,180 KB
testcase_36 AC 58 ms
85,180 KB
testcase_37 AC 47 ms
71,316 KB
testcase_38 AC 82 ms
122,968 KB
testcase_39 AC 114 ms
163,688 KB
testcase_40 AC 128 ms
163,688 KB
testcase_41 AC 82 ms
122,968 KB
testcase_42 AC 112 ms
165,788 KB
testcase_43 AC 54 ms
71,316 KB
testcase_44 AC 80 ms
106,284 KB
testcase_45 AC 202 ms
246,136 KB
testcase_46 AC 63 ms
92,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
d = [[] for _ in range(k + 1)]
d[0].append(0)
for x in map(int, input().split()):
    for i in range(k)[::-1]:
        for s in d[i]:
            d[i+1].append(s + x)
ans = sum(s % 998244353 <= s % 998 for s in d[k]) % 998
print(ans)
0