diff --git a/docs/08_dynamic_programming/08_06_knapsack_problem_01.md b/docs/08_dynamic_programming/08_06_knapsack_problem_01.md index 29554f75..661a0302 100644 --- a/docs/08_dynamic_programming/08_06_knapsack_problem_01.md +++ b/docs/08_dynamic_programming/08_06_knapsack_problem_01.md @@ -296,7 +296,7 @@ class Solution: - [0494. 目标和](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0400-0499/target-sum.md) - [1049. 最后一块石头的重量 II](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/1000-1099/last-stone-weight-ii.md) -- [0-1 背包问题题目列表](https://github.com/itcharge/AlgoNote/tree/main/docs/00_preface/00_06_categories_list.md#0-1-%E8%83%8C%E5%8C%85%E9%97%AE%E9%A2%98%E9%A2%98%E7%9B%AE) +- [0-1 背包问题题目列表](https://github.com/ITCharge/AlgoNote/tree/main/docs/00_preface/00_06_categories_list.md#0-1-%E8%83%8C%E5%8C%85%E9%97%AE%E9%A2%98%E9%A2%98%E7%9B%AE) ## 参考资料 diff --git a/docs/08_dynamic_programming/08_07_knapsack_problem_02.md b/docs/08_dynamic_programming/08_07_knapsack_problem_02.md index 8be8aa10..ee989a7e 100644 --- a/docs/08_dynamic_programming/08_07_knapsack_problem_02.md +++ b/docs/08_dynamic_programming/08_07_knapsack_problem_02.md @@ -260,12 +260,12 @@ class Solution: ## 练习题目 -- [0279. 完全平方数](https://github.com/itcharge/AlgoNote/tree/main/docs/solutions/0200-0299/perfect-squares.md) -- [0322. 零钱兑换](https://github.com/itcharge/AlgoNote/tree/main/docs/solutions/0300-0399/coin-change.md) -- [0518. 零钱兑换 II](https://github.com/itcharge/AlgoNote/tree/main/docs/solutions/0500-0599/coin-change-ii.md) -- [0377. 组合总和 IV](https://github.com/itcharge/AlgoNote/tree/main/docs/solutions/0300-0399/combination-sum-iv.md) +- [0279. 完全平方数](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0200-0299/perfect-squares.md) +- [0322. 零钱兑换](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0300-0399/coin-change.md) +- [0518. 零钱兑换 II](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0500-0599/coin-change-ii.md) +- [0377. 组合总和 IV](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0300-0399/combination-sum-iv.md) -- [完全背包问题题目列表](https://github.com/itcharge/AlgoNote/tree/main/docs/00_preface/00_06_categories_list.md#%E5%AE%8C%E5%85%A8%E8%83%8C%E5%8C%85%E9%97%AE%E9%A2%98%E9%A2%98%E7%9B%AE) +- [完全背包问题题目列表](https://github.com/ITCharge/AlgoNote/tree/main/docs/00_preface/00_06_categories_list.md#%E5%AE%8C%E5%85%A8%E8%83%8C%E5%8C%85%E9%97%AE%E9%A2%98%E9%A2%98%E7%9B%AE) ## 参考资料 diff --git a/docs/08_dynamic_programming/08_08_knapsack_problem_03.md b/docs/08_dynamic_programming/08_08_knapsack_problem_03.md index 7c5af156..f7f3d79a 100644 --- a/docs/08_dynamic_programming/08_08_knapsack_problem_03.md +++ b/docs/08_dynamic_programming/08_08_knapsack_problem_03.md @@ -206,7 +206,7 @@ class Solution: ## 练习题目 -- [多重背包问题题目列表](https://github.com/itcharge/AlgoNote/tree/main/docs/00_preface/00_06_categories_list.md#%E5%A4%9A%E9%87%8D%E8%83%8C%E5%8C%85%E9%97%AE%E9%A2%98%E9%A2%98%E7%9B%AE) +- [多重背包问题题目列表](https://github.com/ITCharge/AlgoNote/tree/main/docs/00_preface/00_06_categories_list.md#%E5%A4%9A%E9%87%8D%E8%83%8C%E5%8C%85%E9%97%AE%E9%A2%98%E9%A2%98%E7%9B%AE) ## 参考资料 diff --git a/docs/08_dynamic_programming/08_09_knapsack_problem_04.md b/docs/08_dynamic_programming/08_09_knapsack_problem_04.md index 041749a4..e5541434 100644 --- a/docs/08_dynamic_programming/08_09_knapsack_problem_04.md +++ b/docs/08_dynamic_programming/08_09_knapsack_problem_04.md @@ -329,8 +329,8 @@ class Solution: - [1155. 掷骰子等于目标和的方法数](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/1100-1199/number-of-dice-rolls-with-target-sum.md) - [0474. 一和零](https://github.com/ITCharge/AlgoNote/tree/main/docs/solutions/0400-0499/ones-and-zeroes.md) -- [分组背包问题题目列表](https://github.com/itcharge/AlgoNote/tree/main/docs/00_preface/00_06_categories_list.md#%E5%88%86%E7%BB%84%E8%83%8C%E5%8C%85%E9%97%AE%E9%A2%98%E9%A2%98%E7%9B%AE) -- [多维背包问题题目列表](https://github.com/itcharge/AlgoNote/tree/main/docs/00_preface/00_06_categories_list.md#%E5%A4%9A%E7%BB%B4%E8%83%8C%E5%8C%85%E9%97%AE%E9%A2%98%E9%A2%98%E7%9B%AE) +- [分组背包问题题目列表](https://github.com/ITCharge/AlgoNote/tree/main/docs/00_preface/00_06_categories_list.md#%E5%88%86%E7%BB%84%E8%83%8C%E5%8C%85%E9%97%AE%E9%A2%98%E9%A2%98%E7%9B%AE) +- [多维背包问题题目列表](https://github.com/ITCharge/AlgoNote/tree/main/docs/00_preface/00_06_categories_list.md#%E5%A4%9A%E7%BB%B4%E8%83%8C%E5%8C%85%E9%97%AE%E9%A2%98%E9%A2%98%E7%9B%AE) ## 参考资料 diff --git a/docs/08_dynamic_programming/index.md b/docs/08_dynamic_programming/index.md index 2fdd3502..bb50b40b 100644 --- a/docs/08_dynamic_programming/index.md +++ b/docs/08_dynamic_programming/index.md @@ -8,19 +8,19 @@ ## 本章内容 -- [8.1 动态规划基础](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_01_dynamic_programming_basic.md) -- [8.2 记忆化搜索](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_02_memoization_search.md) -- [8.3 线性 DP(一):单串线性 DP 问题](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_03_linear_dp_01.md) -- [8.4 线性 DP(二):双串线性 DP 问题](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_04_linear_dp_02.md) -- [8.5 线性 DP(三):矩阵线性 DP 问题、无串线性 DP 问题](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_05_linear_dp_02.md) -- [8.6 背包问题知识(一):0-1 背包问题](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_06_knapsack_problem_01.md) -- [8.7 背包问题知识(二):完全背包问题](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_07_knapsack_problem_02.md) -- [8.8 背包问题知识(三):多重背包问题](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_08_knapsack_problem_03.md) -- [8.9 背包问题知识(四):混合背包问题、分组背包问题](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_09_knapsack_problem_04.md) -- [8.10 背包问题知识(五):背包问题变种](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_10_knapsack_problem_05.md) -- [8.11 区间 DP](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_11_interval_dp.md) -- [8.12 树形 DP](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_12_tree_dp.md) -- [8.13 状态压缩 DP](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_13_state_compression_dp.md) -- [8.14 计数 DP](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_14_counting_dp.md) -- [8.15 数位 DP](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_15_digit_dp.md) -- [8.16 概率 DP](https://github.com/itcharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_16_probability_dp.md) +- [8.1 动态规划基础](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_01_dynamic_programming_basic.md) +- [8.2 记忆化搜索](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_02_memoization_search.md) +- [8.3 线性 DP(一):单串线性 DP](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_03_linear_dp_01.md) +- [8.4 线性 DP(二):双串线性 DP](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_04_linear_dp_02.md) +- [8.5 线性 DP(三):矩阵线性 DP、无串线性 DP](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_05_linear_dp_02.md) +- [8.6 背包问题知识(一):0-1 背包](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_06_knapsack_problem_01.md) +- [8.7 背包问题知识(二):完全背包](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_07_knapsack_problem_02.md) +- [8.8 背包问题知识(三):多重背包](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_08_knapsack_problem_03.md) +- [8.9 背包问题知识(四):混合背包、分组背包](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_09_knapsack_problem_04.md) +- [8.10 背包问题知识(五):背包问题变种](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_10_knapsack_problem_05.md) +- [8.11 区间 DP](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_11_interval_dp.md) +- [8.12 树形 DP](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_12_tree_dp.md) +- [8.13 状态压缩 DP](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_13_state_compression_dp.md) +- [8.14 计数 DP](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_14_counting_dp.md) +- [8.15 数位 DP](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_15_digit_dp.md) +- [8.16 概率 DP](https://github.com/ITCharge/AlgoNote/tree/main/docs/08_dynamic_programming/08_16_probability_dp.md) diff --git a/docs/solutions/0500-0599/out-of-boundary-paths.md b/docs/solutions/0500-0599/out-of-boundary-paths.md index c486feae..b1fbabbc 100644 --- a/docs/solutions/0500-0599/out-of-boundary-paths.md +++ b/docs/solutions/0500-0599/out-of-boundary-paths.md @@ -119,7 +119,7 @@ class Solution: mod = 10 ** 9 + 7 dp = [[[0 for _ in range(maxMove + 1)] for _ in range(n)] for _ in range(m)] - for i in r + for k in range(1, maxMove + 1): for i in range(m): for j in range(n):

AltStyle によって変換されたページ (->オリジナル) /