
dfs
蕾姆的小迷弟
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
06-图1 列出连通集
06-图1 列出连通集 (25 分) 给定一个有N个顶点和E条边的无向图,请用DFS和BFS分别列出其所有的连通集。假设顶点从0到N−1编号。进行搜索时,假设我们总是从编号最小的顶点出发,按编号递增的顺序访问邻接点。 输入格式: 输入第1行给出2个整数N(0<N≤10)和E,分别是图的顶点数和边数。随后E行,每行给出一条边的两个端点。每行中的数字之间用1空格分隔。 输出格式: 按照"{v1v2...vk}"的格式,每行输出一个连通集。先输出DFS的结果,再输出BF...原创 2021-05-09 19:41:06 · 340 阅读 · 0 评论 -
HDU 1010 (Tempter of the Bone)
Tempter of the Bone Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel th原创 2017-08-09 17:43:50 · 243 阅读 · 0 评论 -
HDU 1016 (Prime Ring Problem)
Prime Ring Problem Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 53427 Accepted Submission(s): 23627 Problem Description A ring is原创 2017-08-15 20:03:57 · 274 阅读 · 0 评论 -
poj 2386 Lake Counting
Lake CountingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 41379 Accepted: 20528DescriptionDue to recent rains, water has pooled in various places in Farmer John's field, which is represen...原创 2018-04-08 13:04:07 · 179 阅读 · 0 评论