随笔分类 -  算法笔记

摘要:01背包 01背包模板 func zeroOneKnapsack(weights []int, values []int, capacity int) int { n := len(weights) // dp[i][j] 表示:考虑前 i 个物品(索引从 0 到 i-1),容量为 j 时的最大价值 阅读全文
posted @ 2025-08-01 16:34 wushucan 阅读(3) 评论(0) 推荐(0)