[20251206] BOJ / G2 / 환승 / 권혁준 #1596
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/5214
🧭 풀이 시간
10분
👀 체감 난이도
✏️ 문제 설명
N개의 역과 M개의 하이퍼튜브가 있다.
하이퍼튜브 하나는 역 K개를 서로 연결한다.
1번 역에서 N번 역으로 가는데 방문하는 최소 역의 수를 구해보자.
🔍 풀이 방법
정점 1부터 N까지는 원래의 역, N+1부터 N+M까지는 i번째 하이퍼튜브를 나타내는 가상의 정점으로 생각하고 0-1 BFS로 최단 거리를 구했다.
⏳ 회고
최근에 본 문제들 중 가장 교육적인 문제인 듯