結果
| 問題 | No.2561 みんな大好きmod 998 | 
| コンテスト | |
| ユーザー |  Lucagon | 
| 提出日時 | 2023-12-02 14:53:33 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1,715 ms / 4,000 ms | 
| コード長 | 373 bytes | 
| コンパイル時間 | 447 ms | 
| コンパイル使用メモリ | 82,304 KB | 
| 実行使用メモリ | 486,548 KB | 
| 最終ジャッジ日時 | 2024-09-26 17:39:13 | 
| 合計ジャッジ時間 | 19,995 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 44 | 
ソースコード
from itertools import combinations
n,k = map(int,input().split())
a = list(map(int,input().split()))
c = list(combinations(a,k))
ans = 0
amod = 998244353
bmod = 998
for i in c:
    cnt1 = 0
    cnt2 = 0
    for j in i:
        cnt1 += j
        cnt2 += j
        cnt1 %= amod
        cnt2 %= bmod
    
    if cnt1 <= cnt2:
        ans += 1
        ans %= bmod
print(ans)
            
            
            
        