include<bits/stdc++.h> include include<math.h> define ll long long using namespace std;int n, m;char p[505][505];bool judge[505][505];int dx[4] = {-1,0,1,0};int dy[4] = {0,1,0,-1};//方向bool flag;bool check(int a,int b){ if(a < 1||a > n)return 0; if(b < 1||b > m)return 0;...