[20251102] BOJ / P1 / Imperial roads / 권혁준 #1296
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/15060
🧭 풀이 시간
20분
👀 체감 난이도
✏️ 문제 설명
정점 N개 간선 R개인 그래프에 Q개의 쿼리를 처리해보자.
🔍 풀이 방법
특정 간선 (a,b)를 꼭 추가해야 한다면, 원래의 MST 상에서 a와 b를 잇는 경로의 간선 가중치 중에서 가장 큰 걸 빼고 (a,b)를 추가해야 가중치가 가장 작아진다.
⏳ 회고
ez