[20250206] BOJ / 골드3 / 아기돼지와 늑대 / 권혁준 #53
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/16441
🧭 풀이 시간
10분
👀 체감 난이도
✏️ 문제 설명
격자 그래프의 각 칸은 초원, 산, 빙판 중 하나이고, 어떤 칸에는 늑대가 살고 있다.
늑대는 빙판 위에선 미끄러지고, 산으로는 갈 수 없다고 할 때, 늑대로부터 안전한 칸을
P로 대체해서 출력해야 한다.🔍 풀이 방법
기본 BFS인데, 4방향 좌표 구할 때 빙판이면 그 방향으로 미끄러지도록 while문을 써주자.
⏳ 회고
미끄러지는 구현이 재밌다