結果

問題 No.2561 みんな大好きmod 998
ユーザー flippergo
提出日時 2025-03-24 12:06:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 517 ms / 4,000 ms
コード長 259 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 82,388 KB
実行使用メモリ 76,292 KB
最終ジャッジ日時 2025-03-24 12:06:17
合計ジャッジ時間 9,421 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations
N,K = map(int,input().split())
A = list(map(int,input().split()))
MOD1 = 998
MOD2 = 998244353
cnt = 0
for z in combinations(A,K):
    a = sum(z)
    a1 = a%MOD1
    a2 = a%MOD2
    if a1>=a2:
        cnt += 1
print(cnt%MOD1)
0