disjoint-set
-
4 - 2. Closing the Farm (Gold)CS/ProblemSolving 2022. 6. 5. 15:17
https://www.acmicpc.net/problem/12012 12012번: Closing the Farm (Gold) The output consists of \(N\) lines, each containing "YES" or "NO". The first line indicates whether the initial farm is fully connected, and line \(i+1\) indicates whether the farm is fully connected after the \(i\)th closing. www.acmicpc.net 완전 좋아하는 알고리즘 중 하나인 서로소 집합 문제인데, 거기에 오프라인 쿼리를 잘 곁들인 문제라 소개해볼까 가져왔습니다. USACO 우리의 주인공 농부..