U11Try7
This commit is contained in:
parent
e9e8d21971
commit
bb72482df1
@ -32,7 +32,7 @@ def maximum_value(maximum_weight, items):
|
||||
|
||||
if weight[index] <=zostava:
|
||||
better = max(better,value[index] + vyries(pocet - 1,zostava - weight[index]))
|
||||
|
||||
|
||||
pamat[stav] = better
|
||||
return better
|
||||
|
||||
@ -42,4 +42,11 @@ def maximum_value(maximum_weight, items):
|
||||
|
||||
|
||||
def maximum_value_with_items(maximum_weight, items):
|
||||
pass
|
||||
if items == 0 or items is None or items ==[]:
|
||||
return 0
|
||||
if len(items) == 1:
|
||||
curent_dic = items[0]
|
||||
weight = curent_dic.get("weight")
|
||||
if weight > maximum_weight:
|
||||
return 0
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user