data-structure-experiments/1/solution2.md

164 B

思路

使用 dfs,搜索每一件物品的选择情况,符合条件时输出。

使用 sum+w[k]<=T 进行剪枝,提高运行速度

代码及解释