Rosetta Problems

一个图论问题

https://www.acwing.com/problem/content/5432