結果

問題 No.2561 みんな大好きmod 998
コンテスト
ユーザー Cecil
提出日時 2023-12-02 17:20:16
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 352 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 867 ms
コンパイル使用メモリ 85,248 KB
実行使用メモリ 65,408 KB
最終ジャッジ日時 2026-04-13 20:46:50
合計ジャッジ時間 10,438 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 44
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from collections import product
import itertools

N,K = map(int, input().split())
A = list(map(int, input().split()))

l = [ i for i in range(N) ]
product = itertools.combinations(l, K)
ans = 0
for p in product:
    #print(p)
    s = 0
    for i in p:
        s += A[i]
    if s%998244353 <= s%998:
        ans += 1
    ans %= 998
ans %= 998
print(ans)
0