标准的BFS板子 #include<iostream> #include<queue> using namespace std; char arr[1001][1001]; bool visit[1001][1001]; int pos[4][2] = { {0,1},{0,-1},{1,0},{-1,0} }; struct Node { int x; int y; int length; }; int BFS(int c_x, int c_y, int x, int y,int n,int m) { for (int i = 1; i <= n;...