We have n black points and n white points with their x values. If we connect each black point with a white point by wire. Which algorithm will cause the lowest wire needed.
# | User | Rating |
---|---|---|
1 | tourist | 3843 |
2 | jiangly | 3705 |
3 | Benq | 3628 |
4 | orzdevinwang | 3571 |
5 | Geothermal | 3569 |
5 | cnnfls_csy | 3569 |
7 | jqdai0815 | 3530 |
8 | ecnerwala | 3499 |
9 | gyh20 | 3447 |
10 | Rebelz | 3409 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 171 |
2 | awoo | 163 |
3 | adamant | 162 |
4 | TheScrasse | 158 |
5 | nor | 153 |
5 | maroonrk | 153 |
7 | -is-this-fft- | 152 |
8 | Petr | 146 |
9 | orz | 145 |
10 | pajenegod | 144 |
We have n black points and n white points with their x values. If we connect each black point with a white point by wire. Which algorithm will cause the lowest wire needed.
Consider we have a set of n numbers, and we want to calculate the number of subsets in which the addition of all elements equal to x.
Input first line has n, x and the next line contains n numbers of our set. In the output we have to calculate the number of subsets that have total sum of elements equal to x.
INPUT 4 3 -1 2 4 2
OUTPUT 2
Name |
---|