📅  最后修改于: 2022-03-11 14:55:18.047000             🧑  作者: Mango
vector dp(amount+1, 0);
dp[0] = 1;
for (auto coin : coins)
for (int i=1; i<=amount; i++)
if (coin <= i) dp[i] += dp[i-coin];
return dp[amount];