USACO 2018 December Contest Platinum Problem 3 The Cow Gathering
Cows have assembled from around the world for a massive gathering. There are NN cows, and N−1N−1 pairs of cows who are friends with each other. Every cow knows every other cow through some chain of...