[20260121] BOJ / P4 / K번째 최단경로 찾기 / 김민진 #1809
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.
🧷 문제 링크
K번째 최단경로 찾기
🧭 풀이 시간
40분
👀 체감 난이도
✏️ 문제 설명
N개의 노드가 있을 때 1부터 i까지 도달하는 K번째 최단거리를 차례대로 출력하시오
🔍 풀이 방법
다익스트라인데 k번째 최단거리를 구해야 하기 때문에
dist배열을 우선순위 큐 배열로 둠dist의 우선순위 큐는 길이가K가 되도록 하는 최대힙으로 설정하여 다익스트라가 끝나고peek()을 통해 K번째 최단거리 구할 수 있음⏳ 회고
인터넷 설치 기사 오늘 온대놓고 안 옴
열심히 폰으로 하는 중
눈아파 ㅜ