
搜索
draper__QYT
青年时我有一个梦想,从改变我自己开始
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ 1321 棋盘问题(深搜)
POJ 1321 棋盘问题 题目链接:http://poj.org/problem?id=1321 设置一个数组,用来标记当前列是否有棋子放置 因为按行进行判断,所以同行不可能有其他棋子 #include<cstdio> #include<iostream> using namespace std; int vis[10]; //记录本列是否...原创 2018-07-23 20:15:42 · 253 阅读 · 0 评论 -
HDU 1241 Oil Deposits(DFS)
HDU 1241 Oil Deposits 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1241 典型的dfs判断连通块数目的题目 #include<cstdio> #include<iostream> using namespace std; char land[100][100]; int num; int di...原创 2018-07-23 20:55:17 · 261 阅读 · 0 评论 -
HDU 1016 Prime Ring Problem(DFS)
HDU 1016 Prime Ring Problem dfs进行遍历即可 #include&lt;cstdio&gt; #include&lt;iostream&gt; #include&lt;cstring&gt; using namespace std; //n最大为20,打表到40即可 int prime[40]={0,1,1,1,0,1,0,1,0,0,0,1,0,1,0,0,0...原创 2018-07-24 00:11:30 · 217 阅读 · 0 评论 -
UVA 11624 Fire(双向BFS)
UVA 11624 Fire 题目链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2671 要求人在有限的时间内逃生,与求最短路径相似,用广搜 开设两个二维数组,分别记录人、火到达某点的时间,然后进行两次BFS即可,...原创 2018-07-24 19:20:00 · 286 阅读 · 0 评论 -
POJ 2251 Dungeon Master(BFS)
POJ 2251 Dungeon Master 三维迷宫的bfs,设置三维迷宫数组、移动方向数组、访问标记数组,然后bfs即可 #include<iostream> #include<cstdio> #include<queue> #include<cstring> using namespace std; int vis[35][35][35...原创 2018-07-25 17:02:58 · 379 阅读 · 0 评论