
DFS&&BFS
文章平均质量分 70
阿.荣.
勿弃
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
leetcode 1034. 边界着色【BFS】
import queue class Solution: def colorBorder(self, grid: List[List[int]], row: int, col: int, color: int) -> List[List[int]]: def judeg(grid, x, y, m, n, dir, source): if x == 0 or y == 0 or x == m-1 or y == n-1: .原创 2021-12-08 11:09:29 · 146 阅读 · 0 评论 -
leetcode 407. 接雨水 II【BFS】
给你一个 m x n 的矩阵,其中的值均为非负整数,代表二维高度图每个单元的高度,请计算图中形状最多能接多少体积的雨水。 示例 1: 输入: heightMap = [[1,4,3,1,3,2],[3,2,1,3,2,4],[2,3,3,2,3,1]] 输出: 4 解释: 下雨后,雨水将会被上图蓝色的方块中。总的接雨水量为1+2+1=4。 示例 2: 输入: heightMap = [[3,3,3,3,3],[3,2,2,2,3],[3,2,1,2,3],[3,2,2,2,3],[3,3,3,3,3]] 输原创 2021-11-04 10:22:40 · 156 阅读 · 0 评论 -
codeforces 791 B. Bear and Friendship Condition (DFS搜索)
B. Bear and Friendship Condition time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Bear Limak examines a socia原创 2017-03-29 22:14:52 · 313 阅读 · 0 评论 -
poj 1691 Painting A Board (构图 DFS)
Painting A Board Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 3818 Accepted: 1890 Description The CE digital company has built an Automatic Painting M原创 2017-02-21 20:26:03 · 511 阅读 · 0 评论 -
poj 3278 Catch That Cow
Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 79534 Accepted: 25090 Description Farmer John has been informed of the location of a fugitiv原创 2016-11-19 22:00:20 · 260 阅读 · 0 评论 -
hdoj 2266 How Many Equations Can You Find (dfs)
How Many Equations Can You Find Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 908 Accepted Submission(s): 604 Problem Description原创 2016-10-09 21:51:22 · 358 阅读 · 0 评论 -
codeforces B. Fox And Two Dots (dfs)
B. Fox And Two Dots time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Fox Ciel is playing a mobile puzzle gam原创 2016-08-14 18:00:48 · 279 阅读 · 0 评论 -
zzulioj 1908: 小火山的围棋梦想 (dfs)
1908: 小火山的围棋梦想 Time Limit: 1 Sec Memory Limit: 128 MB Submit: 356 Solved: 98 SubmitStatusWeb Board Description 小火山最近喜欢上了围棋。 对于围棋,其实小火山是一窍不通的。现在棋盘上,有很多小火山的棋子。 如果棋盘上有这样的一个位置, 那么这个位置也原创 2016-08-11 14:46:11 · 590 阅读 · 0 评论 -
codefrces 525 D. Arthur and Walls (bfs-小矩形)
D. Arthur and Walls time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Finally it is a day when Arthur has eno原创 2016-08-19 09:42:29 · 441 阅读 · 0 评论 -
hdoj 1045 Fire Net (dfs)
Fire Net Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10284 Accepted Submission(s): 6024 Problem Description Suppose that we have原创 2016-08-18 21:53:51 · 286 阅读 · 0 评论 -
hdoj 2612 Find a way (bfs,双向搜索)
Find a way Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10380 Accepted Submission(s): 3392 Problem Description Pass a year learni原创 2016-07-29 20:29:32 · 376 阅读 · 0 评论 -
hdoj 1010 Tempter of the Bone (dfs 奇偶剪枝)
Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 107079 Accepted Submission(s): 29114 Problem Description The dog原创 2016-07-30 10:54:17 · 290 阅读 · 0 评论 -
hdoj 1242 Rescue (bfs 优先队列)
Rescue Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24261 Accepted Submission(s): 8557 Problem Description Angel was caught b原创 2016-04-01 22:45:00 · 435 阅读 · 0 评论