南阳理工
文章平均质量分 78
jn_8316
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
组合数
题目连接:http://acm.nyist.net/JudgeOnline/problem.php?pid=32 本题就是DFS练手,要控制输出条件 #include #include #include using namespace std; int n,r; int a[100]; bool b[100]; void dfs(int x,int y) { if(y>r) {原创 2016-04-10 12:20:48 · 242 阅读 · 0 评论 -
水池数目和Lake Counting
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=27 本题是一道全覆盖的搜索题,建议遇到全覆盖问题先采用dfs,dfs不行再选用bfs,而且本题采用了DFS,这道题和POJ上的一道题进行比较,两题只差在相邻的几个点算一个池子 水池数目:必须在DFS中更新地图标记 #include #include #include using n原创 2016-04-10 16:22:12 · 380 阅读 · 0 评论 -
最少步数
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=58 本题要考虑到起点与终点重合的特殊情况,本题不能通过改变地图已通过的道路为1,因为有多组测试数据,这样会破坏到下一次程序执行,地图无法恢复。因此要开一个bool数组去记录走过的道路 #include #include #include #include using namespace原创 2016-04-19 15:49:44 · 297 阅读 · 0 评论
分享