![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
并查集
coder_coder_coder
默默的程序猿
展开
-
poj2513Colored Sticks trie+merge_set+Eular
#include #include #include using namespace std; const int N=250005*4; char s1[15],s2[15],cnt; int chd[N][26],v[N],ID[128],sz=1,du[N],fa[N],color=1; void init(){ sz=1; color=1; memset(v,原创 2014-08-20 23:21:17 · 429 阅读 · 0 评论 -
hdu1272小希的迷宫
//代码 #include #include #include using namespace std; const int N=100005;//考虑同一连通图中有圈(不为树),图不连通(森林) int root=0,n,m,fa[N],vis[N]; void inti(){ for(int i=1;i<=N;i++){ fa[i]=i; } } int原创 2014-08-08 22:40:18 · 288 阅读 · 0 评论