#include #include #include #include #include #include #include #define M 800 using namespace std; struct node { int x,y; node(){} node(int xx,int yy) { x=xx; y=yy; } }gg,mm,zz[2],f[2][M*M]; int step,front[2],rear[2]; char ma[M][M]; int n,m; int dir[4][2]={{-1,0},{0,1},{0,-1},{1,0}}; bool maphaten(int x,int y) { if(x>=0&&x=0&&yq[3]; void clear() { for(int i=0;i<3;i++) while(!q[i].empty()) q[i].pop(); } bool bfs(int num,int move_step,char s,char e) { q[2]=q[num]; for(int i=0;i