处理得很巧妙的DFS+BFS……
题目
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
#define FRE freopen("a.txt","r",stdin);
struct node
{
int x,y;
}queue[1000];
int n,m;
int Max,flag,tatal;
char map[20][20];
char ans[35],stack[35];
int dir[4][2]={-1,0,0,-1,0,1,1,0};
bool yes(int x,int y)
{
return x>=0&&x<n&&y>=0&&y<m;
}
int bfs(int x,int y)
{
node t;
char g[20][20];
for(int i=0;i<n;i++)strcpy......
阅读全文