From 1d206949dd3649f997868536b66b0d268e365965 Mon Sep 17 00:00:00 2001 From: lesleyzhao Date: Sun, 16 Jun 2024 13:27:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0417=E4=B8=ADCarl=E9=A2=98?= =?UTF-8?q?=E8=A7=A3C++=E4=BB=A3=E7=A0=81=E9=87=8C=E7=9A=84=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0417.太平洋大西洋水流问题.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/problems/0417.太平洋大西洋水流问题.md b/problems/0417.太平洋大西洋水流问题.md index b8448e93..5218b571 100644 --- a/problems/0417.太平洋大西洋水流问题.md +++ b/problems/0417.太平洋大西洋水流问题.md @@ -177,14 +177,14 @@ public: // 记录从大西洋出发,可以遍历的节点 vector> atlantic = vector>(n, vector(m, false)); - - // 从最上最下行的节点出发,向高处遍历 + + // 从最左最右列的节点出发,向高处遍历 for (int i = 0; i < n; i++) { dfs (heights, pacific, i, 0); // 遍历最左列,接触太平洋 dfs (heights, atlantic, i, m - 1); // 遍历最右列,接触大西 } - // 从最左最右列的节点出发,向高处遍历 + // 从最上最下行的节点出发,向高处遍历 for (int j = 0; j < m; j++) { dfs (heights, pacific, 0, j); // 遍历最上行,接触太平洋 dfs (heights, atlantic, n - 1, j); // 遍历最下行,接触大西洋