mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
Fix a definition.
This commit is contained in:
@@ -68,7 +68,7 @@ int minPathSumDP(vector<vector<int>> &grid) {
|
||||
return dp[n - 1][m - 1];
|
||||
}
|
||||
|
||||
/* 最小路径和:状态压缩后的动态规划 */
|
||||
/* 最小路径和:空间优化后的动态规划 */
|
||||
int minPathSumDPComp(vector<vector<int>> &grid) {
|
||||
int n = grid.size(), m = grid[0].size();
|
||||
// 初始化 dp 表
|
||||
@@ -108,7 +108,7 @@ int main() {
|
||||
res = minPathSumDP(grid);
|
||||
cout << "从左上角到右下角的最小路径和为 " << res << endl;
|
||||
|
||||
// 状态压缩后的动态规划
|
||||
// 空间优化后的动态规划
|
||||
res = minPathSumDPComp(grid);
|
||||
cout << "从左上角到右下角的最小路径和为 " << res << endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user