
DFS
文章平均质量分 54
深度优先搜索
superkcl2022
这个作者很懒,什么都没留下…
展开
-
poj-1163数字三角形
The TriangleTime Limit:1000MS Memory Limit:10000K Total Submissions:67890 Accepted:40536 Description73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculate...原创 2021-03-11 19:34:59 · 179 阅读 · 0 评论 -
POJ-1164-城堡问题
文章目录1.描述2.解题思路1.描述Figure 1 shows the map of a castle.Write a program that calculates1. how many rooms the castle has2. how big the largest room isThe castle is divided into m * n (m<=50, n<=50) square modules. Each such module can have between原创 2021-05-06 15:36:49 · 416 阅读 · 0 评论 -
DFS入门-图的表示方法
文章目录1. 判断从V出发是否能走到终点:2.判断从V出发是否能走到终点,如果能,要记录路径1. 判断从V出发是否能走到终点:bool dfs(v){ if(V是终点) return true; if(V是旧点) return false; 将V标记为旧点; 对和V相邻的每个节点U{ if(dfs(u) == true) return true; } return false;}2.判断从V出发是否能走到终点,如果能,要记录路径Node path[MAX_LEN];int de原创 2021-05-06 11:01:37 · 202 阅读 · 0 评论