poj - 1611 The Suspects

并查集,求和0号同集合的点有多少个。html 1 #include <stdio.h> 2 #include <string.h> 3 #define N 30005 4 int fa[N],num[N]; 5 int find(int a) 6 { 7 if(fa[a] == a) return a; 8 return fa[a] = find(fa[a]);
相关文章
相关标签/搜索