Given n objects the ith of each cost ai.
Given q queries in the form of s,a, b.
Count the number of subsets that contains a and b but sum of cost does not exceed s.
K is the sum of all Ai
N,Q,K<=4000
# | User | Rating |
---|---|---|
1 | tourist | 3880 |
2 | jiangly | 3669 |
3 | ecnerwala | 3654 |
4 | Benq | 3627 |
5 | orzdevinwang | 3612 |
6 | Geothermal | 3569 |
6 | cnnfls_csy | 3569 |
8 | jqdai0815 | 3532 |
9 | Radewoosh | 3522 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | awoo | 161 |
2 | maomao90 | 160 |
3 | adamant | 156 |
4 | maroonrk | 153 |
5 | atcoder_official | 148 |
5 | -is-this-fft- | 148 |
5 | SecondThread | 148 |
8 | Petr | 147 |
9 | nor | 144 |
10 | TheScrasse | 142 |
Knapsack queries
Given n objects the ith of each cost ai.
Given q queries in the form of s,a, b.
Count the number of subsets that contains a and b but sum of cost does not exceed s.
K is the sum of all Ai
N,Q,K<=4000
Name |
---|