Skip to content

Conversation

@zinnnn37
Copy link
Contributor

🧷 문제 링크

택배

🧭 풀이 시간

30분

👀 체감 난이도

✏️ 문제 설명

택배를 전할 때 최단거리로 보냄
이 때 가장 먼저 들르는 곳을 표로 정리하시오

🔍 풀이 방법

플로이드-워셜
최단거리 구하기용 dist와 루트 저장용 route 배열 두 개 선언
최단거리가 업데이트 되면 route도 업데이트함
그래프 입력받을 때 입력할 수 있는 route는 입력해두고 route[i][k]로 업데이트함
k를 거칠 때 더 빠르고 route[i][k]k로 갈 때 가장 먼저 들르는 곳을 저장함

⏳ 회고

다익스트라로도 풀 수 있다네요

@ShinHeeEul ShinHeeEul merged commit 292c8a0 into main Dec 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants