摘要:
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1272方法一:当你输入的x,y的根节点fx,fy相同时,说明已经可达,再连接就是有多余一条路径了。迷宫应该只有一个集合,多余一个就不符合。当直接输入00时,直接输出yes代码:View Code 1 #include<stdio.h> 2 int father[100001]; 3 bool visit[100001]; 4 int find(int x) 5 { 6 while(x!=father[x]) 7 x=father[x]; 8 return x; 9 }10 11 int ma 阅读全文
