We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用专栏中的例子weight: 2,2,4,6,3 value = 3,4,8,9,6
if __name__ == '__main__': # [(weight, value), ...] items_info = [(2, 3), (2, 4), (4, 8), (6, 9), (3, 6)] capacity = 9 print(bag_with_max_value(items_info, capacity))
的结果不是18而是17 检查发现,比如: 刚设置了值为4, 而在下一轮的"for cur_weight in range(capacity+1)中又被设置为了3 最后的结果如下,与专栏老师讲的也不相同
The text was updated successfully, but these errors were encountered:
No branches or pull requests
使用专栏中的例子weight: 2,2,4,6,3 value = 3,4,8,9,6
的结果不是18而是17
检查发现,比如:
刚设置了值为4, 而在下一轮的"for cur_weight in range(capacity+1)中又被设置为了3
最后的结果如下,与专栏老师讲的也不相同
The text was updated successfully, but these errors were encountered: