[20250828] BOJ / G4 / 두 단계 최단 경로 1 / 한종욱 #760
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/23793
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
기본적인 다익스트라 + 경유지
🔍 풀이 방법
단방향이라 다익스트라를 3번 했다.
⏳ 회고
INF = (int) 2e9 + 10으로 문제를 진행했다.INF = (int) 1e9 + 10로 진행했다면, INF + INF도 integer에 담길 수 있지만, 20억이 넘어간 숫자끼리 더한다면 overflow가 발생할 수 있다. 따라서,INF = (int) 2e9 + 10를 한거 자체가 말이 안되고 저렇게 값을 정할꺼면 long으로 정하거나 INF의 범위를(int)1e9로 내리자.