This commit is contained in:
krahets
2024-05-02 01:46:20 +08:00
parent 5e90519796
commit 23353e7960
324 changed files with 420 additions and 419 deletions

View File

@ -5313,7 +5313,7 @@ dp[i, a] = \min(dp[i-1, a], dp[i, a - coins[i-1]] + 1)
<h2 id="1453-coin-change-problem-ii">14.5.3 &nbsp; Coin change problem II<a class="headerlink" href="#1453-coin-change-problem-ii" title="Permanent link">&para;</a></h2>
<div class="admonition question">
<p class="admonition-title">Question</p>
<p>Given <span class="arithmatex">\(n\)</span> types of coins, where the denomination of the <span class="arithmatex">\(i^{th}\)</span> type of coin is <span class="arithmatex">\(coins[i - 1]\)</span>, and the target amount is <span class="arithmatex">\(amt\)</span>. <strong>Each type of coin can be selected multiple times</strong>, <strong>ask how many combinations of coins can make up the target amount</strong>. See the example below.</p>
<p>Given <span class="arithmatex">\(n\)</span> types of coins, where the denomination of the <span class="arithmatex">\(i^{th}\)</span> type of coin is <span class="arithmatex">\(coins[i - 1]\)</span>, and the target amount is <span class="arithmatex">\(amt\)</span>. Each type of coin can be selected multiple times, <strong>ask how many combinations of coins can make up the target amount</strong>. See the example below.</p>
</div>
<p><a class="glightbox" href="../unbounded_knapsack_problem.assets/coin_change_ii_example.png" data-type="image" data-width="100%" data-height="auto" data-desc-position="bottom"><img alt="Example data for Coin Change Problem II" class="animation-figure" src="../unbounded_knapsack_problem.assets/coin_change_ii_example.png" /></a></p>
<p align="center"> Figure 14-26 &nbsp; Example data for Coin Change Problem II </p>
@ -6190,7 +6190,7 @@ aria-label="Footer"
<div class="md-copyright">
<div class="md-copyright__highlight">
Copyright &copy; 2022-2024 krahets<br>The website content is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a>
Copyright &copy; 2024 krahets<br>The website content is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a>
</div>