Subset Sum DP

Правка en1, от 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?

Теги dp

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский longrange 2023-03-26 13:57:01 385 Initial revision (published)