![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MCS 搜索 入门DFS
joker_122
这个作者很懒,什么都没留下…
展开
-
hdu 1010 Tempter of the Bone
DFS #include #include using namespace std; int n,m,t,bi,bj,ei,ej,z,zz; char a[10][10]; int k[4][2]={{0,1},{0,-1},{1,0},{-1,0}}; void f(int x,int y,int r) { int i,xx,yy,t1; if(xn||ym)原创 2015-07-28 22:53:44 · 214 阅读 · 0 评论 -
hdu 1312 Red and Black
h是行,w是列 #include #include #include using namespace std; char a[25][25]; int w,h,z=1; int k[4][2]={{-1,0},{0,-1},{0,1},{1,0}}; void f(int x,int y) { int i,xx,yy; a[x][y]='#';//走过的设为墙 fo原创 2015-07-28 22:38:17 · 284 阅读 · 0 评论 -
hdu 1241 Oil Deposits
用的是深度优先搜索(DFS) 题目大意:计算不相邻的油田数目,如果油田的上,下,左,右,斜边等八个方向也有油田那么算一块油田 #include <iostream> #include <stdio.h> #include <string> using namespace std; char a[105][105]; int m,n; int k[8]...原创 2015-07-28 22:19:47 · 334 阅读 · 0 评论