[20251010] BOJ / G3 / 전국시대 / 한종욱 #1081
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/15809
🧭 풀이 시간
50분
👀 체감 난이도
✏️ 문제 설명
국가들이 동맹과 전쟁을 하는데 모든 기록이 끝나고 남은 나라의 병력은?
🔍 풀이 방법
분리 집합을 사용하는데 집합을 합치는 기준이 size배열이 아니라 power배열 기준이다.
⏳ 회고
size만 쓰다보니까 일반적인 union find를 까먹어서 size배열 필요없는데 썼다. size가 아니라 power가 집합을 합치는 기준이 된다는 게 제일 중요했다.