結果
| 問題 | No.2561 みんな大好きmod 998 | 
| コンテスト | |
| ユーザー |  prd_xxx | 
| 提出日時 | 2023-12-02 14:44:21 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1,010 ms / 4,000 ms | 
| コード長 | 257 bytes | 
| コンパイル時間 | 397 ms | 
| コンパイル使用メモリ | 82,176 KB | 
| 実行使用メモリ | 76,288 KB | 
| 最終ジャッジ日時 | 2024-09-26 17:16:41 | 
| 合計ジャッジ時間 | 15,432 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 44 | 
ソースコード
N,K = map(int,input().split())
A = list(map(int,input().split()))
MOD = 998244353
M = 998
from itertools import combinations
ans = 0
for ptn in combinations(A,K):
    s1 = sum(ptn) % MOD
    s2 = sum(ptn) % M
    if s1 <= s2:
        ans += 1
print(ans%M)
            
            
            
        