Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b8463b5

Browse files
author
robot
committed
2 parents 37e8100 + 392058f commit b8463b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎problems/1970.last-day-where-you-can-still-cross.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ cells 中的所有格子坐标都是 唯一 的。
6767
由于:
6868

6969
- 如果第 n 天可以,那么小于 n 天都可以到达最后一行
70-
- 如果第 n 天不可以,那么大雨 n 天都无法到达最后一行
70+
- 如果第 n 天不可以,那么大于 n 天都无法到达最后一行
7171

72-
基于此,我们可以想到使用能力检测二分中的**最右二分**。而这里的能力检测,我们可以使用 DFS 或者 BFS。而由于起点可能有多个(第一行的所有陆地),因此使用**多源 BFS** 复杂度会更好,因此我们这里选择 BFS 来做。
72+
这有很强的二段性。基于此,我们可以想到使用能力检测二分中的**最右二分**。而这里的能力检测,我们可以使用 DFS 或者 BFS。而由于起点可能有多个(第一行的所有陆地),因此使用**多源 BFS** 复杂度会更好,因此我们这里选择 BFS 来做。
7373

7474
本题还有一种并查集的解法,也非常有意思。具体可参考力扣中国的[官方题解](https://leetcode-cn.com/problems/last-day-where-you-can-still-cross/solution/ni-neng-chuan-guo-ju-zhen-de-zui-hou-yi-9j20y/) 的方法二。
7575

0 commit comments

Comments
(0)

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