Rosetta Problems
← atcoder に戻る
Is it a tree?
https://atcoder.jp/contests/past202206-open/tasks/past202206_g