[20250801] BOJ / G5 / 간선 이어가기 2 / 김수연 #589
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/14284
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
정점 n개, m개의 간선으로 이루어진 무방향 그래프가 주어짐
이때, 정점 s와 t가 연결 되는 시점의 간선ㅇ늬 가중치의 합 최솟값 구하기
🔍 풀이 방법
다익스트라 사용
priorityqueue를 사용해서 연결되어 있는 정점들에서 갈 수 있는 간선들을 우선순위큐에 넣고,
우선순위 큐는 가중치가 작은 순서로 정렬을 해서 연결
⏳ 회고
전형적인 다익스트라 문제다.
근데 이제 오랜만에 풀어서 헷갈린..