搜索问题
文章平均质量分 66
chenlang888
这个作者很懒,什么都没留下…
展开
-
数据结构:图1(DFS遍历)
数据结构:图1(DFS遍历)时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交:0 测试通过:0描述#include using namespace std;int b[20],m[20],a[20][20],n,s;void f(int k){ int i;原创 2012-07-25 16:16:14 · 348 阅读 · 0 评论 -
zoj 1649
#include #include using namespace std;int n,m,s2,e2;int b[205][205],d[4][2]={{1,0},{-1,0},{0,1},{0,-1}};char a[205][205];struct point{ int x,y,step;}p;queue q;int bfs(point pp){ int i,j,k原创 2013-08-07 11:29:08 · 860 阅读 · 0 评论 -
http://poj.org/problem?id=1190
/*此题是对半径和高的枚举搜索,但要进行剪枝 */#include #include #include #include using namespace std;int n,m,minv[21],mins[21],best;void dfs(int M,int v,int s,int r,int h){ int i,j,hmax; if(M==0) { if(v==n&原创 2013-08-10 10:54:05 · 829 阅读 · 0 评论 -
http://poj.org/problem?id=1475(Pushing Boxes)
bfs 嵌套 bfs 先对箱子bfs 再对人bfs是否能达到。#include using namespace std;#include #include #include #include struct point{ int sx,sy,bx,by; string s;}p,pp,t,tt;char map[25][25],di1[4]={'N','S','E','W'},d原创 2013-08-11 17:08:37 · 909 阅读 · 0 评论 -
http://poj.org/problem?id=1376
题意:一个直径机器人在一个m*n格子的木板上走,按照go或者turn命令走,go是指每秒走1-3米,turn是指转90度,花一秒,问从起点到终点要花多少秒知道原来的方向#include #include using namespace std;int n,m,a[55][55],b[55][55],sx,sy,ex,ey,d[4][2]={{-1,0},{0,1},{1,原创 2013-08-13 11:29:55 · 806 阅读 · 0 评论