[백준/BOJ] 백준 18267번 : Milk Visits
https://www.acmicpc.net/problem/18267 18267번: Milk Visits Farmer John is planning to build $N$ ($1 \leq N \leq 10^5$) farms that will be connected by $N-1$ roads, forming a tree (i.e., all farms are reachable from each-other, and there are no cycles). Each farm contains a cow, whose breed is either Guernsey or Ho www.acmicpc.net 길의 정보 x, y를 입력받는데, 만약 x와 y가 같은 종류이면 유니온 파인드의 유니온을 통해 같은 그룹으로 묶는다. 그..
2023.10.25