暴力DFS预处理答案
#include#include #include #include #include #include using namespace std;const int maxn=1000+10;char s[maxn][maxn];struct X{ int x,y; X(int a,int b) { x=a; y=b; }};queue Q;int n,m,k;bool flag[maxn][maxn];int ans[maxn][maxn];int dir[4][2]={ { 1,0}, { -1,0}, { 0,-1}, { 0,1}};bool P(int a,int b){ if(a>=0&&a =0&&b =0&&a-1 =0&&b =0&&a+1 =0&&b =0&&a =0&&b-1 =0&&a =0&&b+1