参考博客 #include<bits/stdc++.h> using namespace std; #define ll long long int const N=1e3+7; int n,m,sx1,sy1,sx2,sy2,f; char ch[N][N]; struct L{ int x,y,t; }; queue<L>q[2]; int vis[N][N][3]; int xx[]={1,-1,0,0,1,-1,1,-1}; int yy[]={0,0,1,-1,1,-1,-1,1}; int bfs(int x){ int zt=q[x].size(); w...