結果
| 問題 | No.2561 みんな大好きmod 998 | 
| コンテスト | |
| ユーザー |  ゼット | 
| 提出日時 | 2023-12-20 23:41:58 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 574 ms / 4,000 ms | 
| コード長 | 295 bytes | 
| コンパイル時間 | 138 ms | 
| コンパイル使用メモリ | 82,372 KB | 
| 実行使用メモリ | 76,164 KB | 
| 最終ジャッジ日時 | 2024-09-27 10:16:30 | 
| 合計ジャッジ時間 | 8,932 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 44 | 
ソースコード
N,K=map(int,input().split())
P=list(map(int,input().split()))
L=[i for i in range(N)]
from itertools import combinations
result=0
for A in combinations(L,K):
  a=0
  b=0
  for i in range(K):
    a+=P[A[i]]
    b+=P[A[i]]
  a%=998244353
  b%=998
  if b>=a:
    result+=1
result%=998
print(result)
            
            
            
        