Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <bits/stdc++.h>using namespace std;int gox[4]={0,0,1,-1};int goy[4]={1,-1,0,0};struct point{int x,y;int t;point (int _x=0,int _y=0,int _t=0){x=_x;y=_y;t=_t;}};char maze[105][105];int step[105][105];queue<point>q;void bfs(int x,int y){while (!q.empty())q.pop();q.push(point(x,y,0));step[x][y]=0;while (!q.empty()){point p=q.front();q.pop();for (int i=0;i<4;i++){x=p.x+gox[i];y=p.y+goy[i];if (maze[x][y]=='.'&&step[x][y]==-1)