結果
| 問題 | No.2561 みんな大好きmod 998 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-06-18 01:03:31 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 347 ms / 4,000 ms |
| コード長 | 347 bytes |
| 記録 | |
| コンパイル時間 | 341 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 80,284 KB |
| 最終ジャッジ日時 | 2026-06-18 01:03:39 |
| 合計ジャッジ時間 | 6,282 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 |
ソースコード
# comb(28,8) ~ 3.1*10**6
# これを全探索でギリ<10**8
from itertools import combinations
N,K = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
for c in combinations(list(range(N)),K):
S = 0
for e in c:
S += A[e]
if S % 998244353 <= S % 998:
ans += 1
print(ans % 998)