Python:实现knapsack背包问题算法 from __future__ import annotations def knapsack(capacity: int, weights: list[int], values: list[