u11 update
This commit is contained in:
parent
b69ca78df5
commit
abd51544a8
@ -33,10 +33,10 @@ def maximum_value_with_items(maximum_weight, 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:
|
||||||
NewV = currV + v
|
NewV = currV + v
|
||||||
if NewV > Novystav.get(NEwW, (0, []))[0]:
|
if NewV > Novystav.get(NEwW, (0, []))[0]:
|
||||||
Novystav[NEwW] = (NewV, vibir + [item])
|
Novystav[NEwW] = (NewV, vibir + [item])
|
||||||
|
|
||||||
stav = Novystav
|
stav = Novystav
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user