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]);
相關文章
相關標籤/搜索