[20250908] PGM / LV2 / 게임 맵 최단거리 / 김수연 #849
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://school.programmers.co.kr/learn/courses/30/lessons/1844
🧭 풀이 시간
20분
👀 체감 난이도
✏️ 문제 설명
두 팀으로 나누어서 게임을 진행하는데, 상대 팀 진영을 먼저 파괴하면 이기는 게임
캐릭터가 상대 팀 진영에 도착하기 위해서 지나가야 하는 칸의 개수의 최솟값 구하기
🔍 풀이 방법
bfs이용
visit 했는지 여부 확인하고, 상대 팀 진영 좌표가 처음 나올 때가 지나가야 하는 칸 개수의 최솟값임
⏳ 회고
기본 bfs다