u11 update
This commit is contained in:
parent
93ad1b43d6
commit
4b1bdcd29b
@ -25,13 +25,12 @@ def maximum_value_with_items(maximum_weight, items):
|
|||||||
return 0, []
|
return 0, []
|
||||||
|
|
||||||
stav = {0: (0,[])}
|
stav = {0: (0,[])}
|
||||||
|
|
||||||
|
for item in items:
|
||||||
w = item["weight"]
|
w = item["weight"]
|
||||||
v = item["value"]
|
v = item["value"]
|
||||||
Novystav = dict(stav)
|
Novystav = dict(stav)
|
||||||
|
|
||||||
for currW,(currV, vibir) in stav.items():
|
|
||||||
|
|
||||||
for currW,(currV, vibir) in stav.items():
|
for currW,(currV, vibir) in stav.items():
|
||||||
NEwW = currW + w
|
NEwW = currW + w
|
||||||
if NEwW <= maximum_weight:
|
if NEwW <= maximum_weight:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user