hdu 1180 bfs(奇偶性)

点击打开链接

#include 
#include 
#include 
#include 
using namespace std;
const int M=30;
typedef struct{
	int x2;
	int y2;
}MOVE;
MOVE Move[4]={{-1,0},{0,-1},{1,0},{0,1}};
struct Node{
	int x;
	int y;
	int time;
	Node(int x1,int y1,int d):x(x1),y(y1),time(d)
	{
		
	}
	Node()
	{
		
	}
	bool operator < (const Node &t) const 
      { return time > t.time; }
};
int m,n,visit[M][M],num,sx,sy,ex,ey;
char g[M][M];
bool check(int a,int b)
{
	if(a>=0&&a=0&&b q;
	q.push(Node(sx,sy,0)); // 时间递增 
	int cur;
	int i,j,a,b,x1,y1;
	while(!q.empty())
	{
		Node t=q.top();
		q.pop();
		x1=t.x;
		y1=t.y;
		cur=t.time;
		if(g[x1][y1]=='T')
		{
			cout<>m>>n)
	{
		memset(visit,0,sizeof(visit));
		int i,j;
		for(i=0;i>g[i][j];
				if(g[i][j]=='S')
				{
					sx=i;
					sy=j;
				}
			}
		}
		bfs();
	}
 	return 0;
}


你可能感兴趣的:(搜索)