結果
問題 | No.2561 みんな大好きmod 998 |
ユーザー |
![]() |
提出日時 | 2023-12-12 22:39:50 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 430 ms / 4,000 ms |
コード長 | 266 bytes |
コンパイル時間 | 532 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 252,240 KB |
最終ジャッジ日時 | 2024-09-27 05:04:06 |
合計ジャッジ時間 | 7,717 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 |
ソースコード
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]) % 998print(ans)