結果

問題 No.2561 みんな大好きmod 998
ユーザー navel_tos
提出日時 2023-12-02 14:43:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 810 ms / 4,000 ms
コード長 274 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 76,288 KB
最終ジャッジ日時 2024-09-26 17:14:55
合計ジャッジ時間 12,087 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

#緑以下E

from itertools import combinations

N,K = map(int,input().split())
A = list(map(int,input().split()))
M = 998
MOD = 998244353
ans = 0
for S in combinations([i for i in range(N)],K):
    S = sum(A[i] for i in S)
    if S % MOD <= S % M: ans += 1

print(ans % M)
0