http://acm.hdu.edu.cn/showproblem.php?pid=1728
#include <iostream>
#include<cstdio>
#include<queue>
#include<cstring>
using namespace std;
/*
刚开始就DFS,果断TLE了,不会剪枝,其实也不知道怎样BFS,百度了一下,
我擦,恍然大悟,一条道走到黑呗,注意vis[][]的更新
*/
const int N=100;
int m,n,vis[N][N];
char maze[N][N];
int x1,x2,y1,y2,d;
int next[4][2]={0,1,1,0,-1,0,0,-1};
int ok(int x,int y)
{
if(x<0||x>=m||y<0||y>=n||maze[x][y]=='*')
return 0;
return 1;
}
struct node
{
int x,y;
};
bool bfs(int x,int y)
{
if(x==x2&&y==y2)
return 1;
int uk;
node p,pp;
p.x=