Rosetta Problems

Cycle Detection for a Directed Graph

https://onlinejudge.u-aizu.ac.jp/problems/GRL_4_A