![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DFS
文章平均质量分 62
ykycode
安徽大学计算机学硕。
两次获得大学生数学竞赛省一等奖,且排名前列。
蓝桥杯C++组省一、国三。
毕业曾被国家电网录用,热爱代码的心让我选择了一家上市公司的C++开发岗。
后来又转行Java开发。
展开
-
树与图的深度优先遍历、宽度优先遍历算法总结
【代码总结】树和图的深度优先遍历、广度优先遍历算法总结原创 2023-12-23 23:42:47 · 390 阅读 · 0 评论 -
DFS与BFS算法总结
【代码总结】DFS(深度优先搜索)、BFS(宽度优先搜索)算法总结原创 2023-12-23 23:06:26 · 577 阅读 · 0 评论 -
油田(Oil Deposits,UVa 572)
#include #include const int maxn=100+5;char pic[maxn][maxn];int m,n,idx[maxn][maxn];void dfs(int r,int c,int id){ if(r=m||c=n) return; if(idx[r][c]>0||pic[r][c]!='@') return; idx[r]原创 2017-09-26 23:54:24 · 268 阅读 · 0 评论 -
枚举题目总结
将数字1~9分别填入9个方框中,每个数字只能使用一次使得等式成立。例如173+286=459就是一个合理的组合,请问一共有多少种合理的组合呢?注意:173+286=459与286+173=459是同一种组合!#include #define rep(i,s,t) for(int i=(s);i原创 2017-10-21 00:20:52 · 2428 阅读 · 2 评论 -
PAT (Advanced Level) Practise 1013. Battle Over Cities (25)
1013. Battle Over Cities (25)It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are close原创 2017-12-21 08:58:32 · 153 阅读 · 0 评论 -
PAT (Advanced Level) Practise 1004. Counting Leaves (30)
A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.InputEach input file contains one test case. Each case starts with原创 2017-12-13 09:27:54 · 144 阅读 · 0 评论 -
HDU1010 Tempter of the Bone(dfs+奇偶剪枝)
Problem DescriptionThe 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 the ground sinking. He real...原创 2018-06-03 10:11:11 · 166 阅读 · 0 评论