Fix a definition.

This commit is contained in:
krahets
2023-08-27 00:50:18 +08:00
parent debf42b189
commit 9731a46d67
85 changed files with 167 additions and 159 deletions

View File

@@ -24,7 +24,7 @@ func unboundedKnapsackDP(wgt: [Int], val: [Int], cap: Int) -> Int {
return dp[n][cap]
}
/* */
/* */
func unboundedKnapsackDPComp(wgt: [Int], val: [Int], cap: Int) -> Int {
let n = wgt.count
// dp
@@ -56,7 +56,7 @@ enum UnboundedKnapsack {
var res = unboundedKnapsackDP(wgt: wgt, val: val, cap: cap)
print("不超过背包容量的最大物品价值为 \(res)")
//
//
res = unboundedKnapsackDPComp(wgt: wgt, val: val, cap: cap)
print("不超过背包容量的最大物品价值为 \(res)")
}