Get your own website
Python
C
Java
 
Python result:
C result:
Java result:
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 300, 300, 300, 300, 300, 300, 300, 300, 300]
[0, 200, 300, 500, 500, 500, 500, 500, 500, 500, 500]
[0, 200, 300, 500, 500, 500, 600, 700, 900, 900, 900]
[0, 200, 300, 500, 700, 800, 1000, 1000, 1000, 1100, 1200]

Maximum value in Knapsack = 1200
0 0 0 0 0 0 0 0 0 0 0
0 0 300 300 300 300 300 300 300 300 300
0 200 300 500 500 500 500 500 500 500 500
0 200 300 500 500 500 600 700 900 900 900
0 200 300 500 700 800 1000 1000 1000 1100 1200

Maximum value in Knapsack = 1200
0 0 0 0 0 0 0 0 0 0 0
0 0 300 300 300 300 300 300 300 300 300
0 200 300 500 500 500 500 500 500 500 500
0 200 300 500 500 500 600 700 900 900 900
0 200 300 500 700 800 1000 1000 1000 1100 1200

Maximum value in Knapsack = 1200