結果
| 問題 | No.2561 みんな大好きmod 998 | 
| コンテスト | |
| ユーザー |  Cecil | 
| 提出日時 | 2023-12-02 17:44:11 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2,159 ms / 4,000 ms | 
| コード長 | 335 bytes | 
| コンパイル時間 | 245 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 10,624 KB | 
| 最終ジャッジ日時 | 2024-09-26 21:18:19 | 
| 合計ジャッジ時間 | 26,785 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 44 | 
ソースコード
import itertools
from itertools import combinations
N,K = map(int, input().split())
A = list(map(int, input().split()))
product = itertools.combinations(A, K)
"""for p in product:
    print(p)"""
ans = 0
for p in product:
    #print(p)
    s = sum(p)
    if s%998244353 <= s%998:
        ans += 1
    ans %= 998
ans %= 998
print(ans)
            
            
            
        