結果
問題 | No.2561 みんな大好きmod 998 |
ユーザー |
![]() |
提出日時 | 2023-10-29 18:52:02 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 469 ms / 4,000 ms |
コード長 | 438 bytes |
コンパイル時間 | 243 ms |
コンパイル使用メモリ | 82,208 KB |
実行使用メモリ | 75,904 KB |
最終ジャッジ日時 | 2024-09-25 22:28:39 |
合計ジャッジ時間 | 8,793 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 |
ソースコード
from itertools import combinationsdef main():N,K = map(int,input().split())assert 1 <= N <= 35assert 1 <= K <= min(8,N)A = list(map(int,input().split()))for a in A:assert 0 <= a <= 998244352ans = 0for comb in combinations(A,K):sum_comb = sum(comb)if sum_comb % 998244353 <= sum_comb % 998:ans += 1print(ans % 998)if __name__ == "__main__":main()