시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
5 초 | 512 MB | 133 | 47 | 36 | 48.000% |
Given a multiset of integers $A = \{a_1, a_2, \dots, a_n\}$, print the least $k$ sums among all non-empty subsets in sorted order.
The first line contains $2$ integers $n, k$ ($1 \leq n \leq 200000, 1 \leq k \leq \min\{2^n - 1, 200000\}$).
The second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($|a_i| \leq 10^9$).
$k$ integers denote the least $k$ sums.
2 3 -1 1
-1 0 1
3 7 -1 0 1
-1 -1 0 0 0 1 1