[20250819] BOJ / G3 / 벽 부수고 이동하기 2 / 이준희 #693
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/14442
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
이동할 수 있는 칸이 있고 벽이 있는 칸이 있는 행렬 맵에서
1,1 에서 n,m 으로 갈 수 있는 최소 거리를 출력하는 문제입니다.
이 때 벽을 k 번까지 부술 수 있습니다.
🔍 풀이 방법
bfs를 이용하여 풀이했습니다.
벽 부수는 것을 판단하기 위해 3차원 visited 배열을 사용했습니다.
⏳ 회고
처음에 다음 곳이 목적지인데 +1 안하고 출력해서 틀렸고
이 케이스를 통과한 이후에는 1,1이 출발지이자 목적지인 것을 처리 안해서 틀렸습니다.
좀더 꼼꼼하게 생각할 필요가 있을 것 같습니다.