搜索
文章平均质量分 78
普通网友
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu1010 Tempter of the Bone
Tempter of the Bone #include #include #include char s[104][104]; int n,m,k; int sx,sy; int di,dj,wall=0; struct tv { int x; int y; int number; } T[10010]; int bfs(int num,int sx,int sy原创 2013-08-04 16:09:21 · 459 阅读 · 0 评论 -
hdu 1045 Fire Net
Fire Net #include #define N 5 using namespace std; int map[N][N],ans,m,n; bool visited[N][N],flag; void dfs(int s) { if(s==n*n) { if(ans<m) ans=m; return ; }原创 2013-08-04 21:11:08 · 421 阅读 · 0 评论 -
hdu 1728 逃离迷宫
逃离迷宫 #include #include #include using namespace std; struct Node { int x; int y; }; int dir[4][2]={{-1,0},{1,0},{0,-1},{0,1}}; char map[102][102]; int m,n,step; int ok,sx,sy,ex,ey; int mark[原创 2013-08-04 21:13:58 · 496 阅读 · 0 评论 -
hdu 1312 Red and Black
#include using namespace std; int w,h,n; char z[27][27]; int flag[27][27]; int dir[4][2]={{0,1},{1,0},{-1,0},{0,-1}}; void dfs(int x,int y) { int xx,yy,c; for(c=0;c<4;c++) { xx=x+d原创 2013-08-06 11:25:46 · 651 阅读 · 0 评论 -
hdu 1013 Digital Roots
#include #include using namespace std; int main() { int i,n; string s; while (cin>>s&&s != "0") { n = 0; for (i=0;i < s.length(); i++) { n += s[i] -'0'原创 2013-08-06 16:03:54 · 95 阅读 · 0 评论 -
浅谈搜索(待补充)
广度优先搜索(Breadth-First-Search)和深度优先搜索(Deep-First-Search)是搜索策略中最经常用到的两种方法,特别常用于图的搜索.其中有很多的算法都用到了这两种思想,比如:Dijkstra单源最短路径算法和Prim最小生成树算法都采用了和宽度优先搜索类似的思想。 BFS的思想: 从一个图的某一个顶点V0出发,首先访问和V0相邻的且未被访问过的顶点V1、V2、原创 2014-02-22 20:37:24 · 530 阅读 · 0 评论 -
hdu 1241 Oil Deposits
#include char a[105][105]; int n,m; using namespace std; int bfs(int x,int y) { int xx; int yy; a[x][y]='1'; for(int k=-1;k<2;k++) for(int l=-1;l<2;l++) { xx=x+k;原创 2013-07-29 17:01:41 · 458 阅读 · 0 评论 -
poj 3278 Catch That Cow bfs
Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a poin原创 2014-02-24 15:41:01 · 446 阅读 · 0 评论
分享