http://blog.youkuaiyun.com/hnust_xiehonghao/article/details/9176909 巧妙地将问题转化为判断并查集是否有环的问题 而进一步又巧妙地将平判断环直接融入加入联通分量中