[20251019] BOJ / G4 / 비밀 모임 / 이준희 #1165
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/13424
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
해리와 친구들의 방의 위치와 각 방 사이 통로의 길이가 주어졌을 때
친구들이 모두 만날 수 있는 방 중 이동거리의 합이 가장 작은 경우를 구하는 문제입니다.
🔍 풀이 방법
다익스트라를 이용해서 풀었습니다.
K개의 친구가 N개의 방 중에서 만나기 때문에 dist 배열을 이중배열로 dist[K][N+1]로 하여 각 사람이 다른 방으로 가는 모든 값을 다익스트라로 계산하였습니다.
⏳ 회고
문제 자체는 플로이드-워셜이 더 맞는 것 같은데 뇌가 플며드는 것 같아서 억지 다익스트라 했습니다.