广搜
#include "stdio.h"
#include "string.h"
#include<queue>
using namespace std;
struct team
{
int x,y,crow;
};
char map[101][101];
int a[4][2]={1,0,-1,0,0,1,0,-1},flag[110][110];
int n,m,p,sx,sy,ex,ey;
int judge(int x,int y)
{
if(x>=0&&x<n&&y>=0&&y<m&&map[x][y]=='.')
return 1;
return 0;
}
int bfs()
{
if(sx==ex&&sy==ey)
return 1;
queue<team>q;
team cur,next;
int x,y,k,i;
......
阅读全文