목록2024/03/26 (1)
득이공간

16946번: 벽 부수고 이동하기 4 N×M의 행렬로 표현되는 맵이 있다. 맵에서 0은 이동할 수 있는 곳을 나타내고, 1은 이동할 수 없는 벽이 있는 곳을 나타낸다. 한 칸에서 다른 칸으로 이동하려면, 두 칸이 인접해야 한다. 두 칸이 www.acmicpc.net #include #include #include using namespace std; const int DX[4] = { -1, 0, 1, 0 }; const int DY[4] = { 0, -1, 0, 1 }; int N, M; bool Wall[1000][1000]; bool Visited[1000][1000]; int Area[1000][1000]; int AreaSize[1000000]; int BFS(int AreaNum, int SR..
PS/알고리즘 문제풀이
2024. 3. 26. 15:02