出處:https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2544
解題策略:會形成cycle,使用Floyd Cycle Detection Algorithm判斷是否形成cycle