Subset Sum DP

Revision en1, by longrange, 2023-03-26 13:57:01

I came across a problem in which I had to find a subset of values which gave me sum N ( N~1e12 ). The value array was hard-coded (by me) and now I am struggling to find a solution to this. The size of array is only 52, but I didn't know how to store boolean values for 'possible' array. I tried bitset, but the size of N is too large.

Could anyone suggest some method?

Tags dp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English longrange 2023-03-26 13:57:01 385 Initial revision (published)