[20250630] BOJ / G4 / 사이클 게임 / 이강현 #400
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/20040
🧭 풀이 시간
20분
👀 체감 난이도
✏️ 문제 설명
n개의 점을 m번 선분으로 이음.
이때 사이클이 처음 생기는 차례를 출력
🔍 풀이 방법
분리 집합
⏳ 회고
말만 번지르르하고 그냥 분리집합이었음.
이어진 선분을 다시 잇는 경우 분리집합으로 안풀리는 경우를 고려해서 좀 깊게 생각했는데 문제 조건에 이어진 선분은 다시 안 잇는다고 되어있었음. 문제를 잘 읽자.