#include <bits/stdc++.h> using namespace std; #define endl "\n" const int N = 110; // 最大网格尺寸 // 方向数组:右、下、左、上 int dir[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; // 全局变量 int mp[N][N]; // 网格地图,0表示可通行,1表示障碍 bool vis[N][N]; // 访问标记数组 int n, m; // 网格的行数和列数 // 节点结构体 struct node { int x, y; // 节点坐标 i...