Knapsack queries

Revision en1, by Loserinlife, 2023-12-14 06:02:03

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

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Loserinlife 2023-12-14 06:02:03 231 Initial revision (published)