結果

問題 No.2561 みんな大好きmod 998
コンテスト
ユーザー AP25
提出日時 2026-06-18 01:03:31
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 347 ms / 4,000 ms
コード長 347 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 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
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# 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)
0