백준 2178번 - 미로 탐색
#include using namespace std; int n, m, y, x, ny, nx, visited[103][103]; char adj[103][103]; int dy[4] = {-1, 0, 1, 0}; int dx[4] = {0, 1, 0, -1}; //최단경로 문제-> bfs 이용 int main(){ cin >> n >> m; for(int i=1; i adj[i][j]; } } queue q; visited[1][1] = 1; q.push({1,1}); while(q.size()){ tie(y, x) = q.front(); q.pop(); for(int i=0; i
2023. 11. 8.