結果
問題 | No.2561 みんな大好きmod 998 |
ユーザー |
|
提出日時 | 2023-12-02 15:01:25 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 749 ms / 4,000 ms |
コード長 | 466 bytes |
コンパイル時間 | 333 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 76,032 KB |
最終ジャッジ日時 | 2024-09-26 17:55:03 |
合計ジャッジ時間 | 10,966 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 |
ソースコード
def INT():return int(input())def MI():return map(int, input().split())def LI():return list(map(int, input().split()))from itertools import combinationsN, K = MI()A = LI()nums = list(range(N))cnt = 0for c in combinations(nums, K):S = 0for xk in list(c):S += A[xk]S_998 = S % 998S_998244353 = S % 998244353if S_998244353 <= S_998:cnt += 1cnt %= 998print(cnt)