[20250905] PGM / LV3 / 섬 연결하기 / 김수연 #824
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/42861
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
n개의 섬 사이에 다리 건설하려고 할 때, 최소의 비용으로 모든 섬이 서로 통행 가능하도록 만들 때,
필요한 최소 비용 구하기
🔍 풀이 방법
그냥 구현..
HashSet에 연결되어 있는 섬들의 번호 넣고, cost가 작은 것부터 하나씩 연결했음
⏳ 회고
다익스트라 생각하긴 했는데, 그냥 돌려버림