結果
| 問題 | No.2561 みんな大好きmod 998 | 
| コンテスト | |
| ユーザー |  toshiconner | 
| 提出日時 | 2023-12-02 15:06:00 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 869 ms / 4,000 ms | 
| コード長 | 393 bytes | 
| コンパイル時間 | 428 ms | 
| コンパイル使用メモリ | 82,236 KB | 
| 実行使用メモリ | 76,100 KB | 
| 最終ジャッジ日時 | 2024-09-26 18:03:46 | 
| 合計ジャッジ時間 | 12,314 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 44 | 
ソースコード
from itertools import combinations
N, K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = 0
mod998 = 998
mod998244353 = 998244353
for comb in combinations(range(N), K):
    B = []
    for c in comb:
        B.append(A[c])
    suma = sum(B)
    s1 = suma % mod998
    s2 = suma % mod998244353
    if s1 >= s2:
        ans += 1
        ans %= mod998
print(ans)
            
            
            
        