- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 poj 3984 迷宫问题
最基本的bfs,只是要输出最短路径经过哪些点,网上的高端代码看不懂,只好弱弱的用STL上了。 #include #include #include #include #include #include #include #include using namespace std; int Map[5][5]; int Ans[5][5]; bool flag[5][5]; int
2014-12-24 21:23:27 567
原创 poj 3278 Catch That Cow
水水的bfs #include #include #include #include #include using namespace std; #define INF 100000 int N,K; int ans[100005]; int flag[100005]; queue q; void bfs(){ while(!q.empty()){ int pos=q.fron
2014-12-19 22:15:55 556
原创 poj 2251 Dungeon Master
三维上的bfs,水题一发。 #include #include #include #include #include using namespace std; #define INF 1000000 queue q1,q2,q3;; char Map[35][35][35]; int ans[35][35][35]; int flag1[35][35][35]; int L,R,C;
2014-12-17 21:56:47 502
原创 poj 1321 棋盘问题
直接暴搜就ok,按行dfs,那么行就不会冲突,然后再对列进行标记,判断同一列是否冲突。 做完这道题之后有几个感受:首先总体思路很浅显直白,但在细节实现上,有好多盲点没注意到,还是看discuss上的数据才找到bug,郁闷~~~ #include #include #include #include using namespace std; char Map[10][10]; int f
2014-12-16 18:21:07 449
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人