#include #include #include #include #include using namespace std; typedef struct { int x; //x좌표 int y; //y좌표 int cnt; //이동거리 저장 }node; int map[6][6]; //대기실 저장 배열 bool visited[6][6]; //방문여부 저장배열 int dx[4] = { 1,-1,0,0 }; //상,하,좌,우 탐색 int dy[4] = { 0,0,1,-1 }; bool bfs(int bx, int by) { queueq; q.push({ bx,by,0 }); visited[bx][by] = true; while (!q.empty()) { int qx = q.front().x; int qy = q.front..