mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 12:58:42 +08:00
Fix a definition.
This commit is contained in:
@ -30,7 +30,7 @@ int coinChangeIIDP(vector<int> &coins, int amt) {
|
||||
return dp[n][amt];
|
||||
}
|
||||
|
||||
/* 零钱兑换 II:状态压缩后的动态规划 */
|
||||
/* 零钱兑换 II:空间优化后的动态规划 */
|
||||
int coinChangeIIDPComp(vector<int> &coins, int amt) {
|
||||
int n = coins.size();
|
||||
// 初始化 dp 表
|
||||
@ -60,7 +60,7 @@ int main() {
|
||||
int res = coinChangeIIDP(coins, amt);
|
||||
cout << "凑出目标金额的硬币组合数量为 " << res << endl;
|
||||
|
||||
// 状态压缩后的动态规划
|
||||
// 空间优化后的动态规划
|
||||
res = coinChangeIIDPComp(coins, amt);
|
||||
cout << "凑出目标金额的硬币组合数量为 " << res << endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user