[20251229] BOJ / G3 / 택배 / 김민진 #1752
Merged
+85
−0
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.
🧷 문제 링크
택배
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
택배를 전할 때 최단거리로 보냄
이 때 가장 먼저 들르는 곳을 표로 정리하시오
🔍 풀이 방법
플로이드-워셜
최단거리 구하기용
dist와 루트 저장용route배열 두 개 선언최단거리가 업데이트 되면
route도 업데이트함그래프 입력받을 때 입력할 수 있는
route는 입력해두고route[i][k]로 업데이트함→
k를 거칠 때 더 빠르고route[i][k]는k로 갈 때 가장 먼저 들르는 곳을 저장함⏳ 회고
다익스트라로도 풀 수 있다네요