[20251231] BOJ / G3 / 레이저 통신 / 김민진 #1757
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.
🧷 문제 링크
레이저 통신
🧭 풀이 시간
80분
👀 체감 난이도
✏️ 문제 설명
C로 표시된 곳이 레이저로 통신하기 위해서 설치해야할 최소의 거울 갯수는🔍 풀이 방법
bfs + 다익스트라
시작점을 큐에 넣고 bfs 돌리다가 끝점이 나오면 종료
다익스트라는 최소 거울 수를 저장하면서 사용
그런데 2차원 격자로만 판별하면 중복처리가 제대로 되지 않아 메모리초과 - 똑같이 거울을 n개 써도 다른 방향에서 꺾이는 경우가 있기 때문
그래서 3차원으로 어느 방향에서 들어오는지도 함께 저장 필요
⏳ 회고
생각보다 까다로웠음...
로직 큰 틀은 쉬워서 골3인가?