[BOJ] 2178번: 미로 탐색
https://www.acmicpc.net/problem/2178 4방향으로 BFS를 돌면 된다. #include #include using namespace std; const int dx[] = {-1, 1, 0, 0}, dy[] = {0, 0, -1, 1}; int n, m; char a[102][102]; int vst[102][102]; struct ED { int x, y; ED(int x, int y) : x(x), y(y) {} }; int BFS(int x, int y) { queue q; q.push(ED(x, y)); vst[x][y] = 1; while (!q.empty()) { int xx = q.front().x, yy = q.front().y; q.pop(); if (xx ==..
2018. 8. 2.