Do anyone knows how to solve this dp problem?

Правка en1, от flyingfist, 2025-01-30 12:42:19

This is a modified 0/1 knapsack problem. The first line contains n, the number of array elements. The next n lines contain the array elements. There are three things given for each element. 1) Type 2) Weight 3) Value and W which is the maximum limit of total weight. So, here we have to maximize the total value, by taking each type of element atmost one time. The constraints are 1<=W,Type,Weight,Value<= 5000. How to solve this problem? What would be the states?

Теги dynamic programming

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский flyingfist 2025-01-30 12:42:19 520 Initial revision (published)