并查集
守护生命的绿荷
这个作者很懒,什么都没留下…
展开
-
Zjnu Stadium
Zjnu Stadium Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1171 Accepted Submission(s): 457 Problem Description In 12th Zhejiang原创 2014-03-08 10:56:44 · 441 阅读 · 0 评论 -
codeforces-B. DZY Loves Chemistry
没什么好说的,赤裸裸 #include #include #include #include using namespace std; #define maxn 250 int fa[maxn]; int n; void Init() { for(int i=1;i fa[i]=i; } int find(int x) { if(x!=fa[x])原创 2014-07-30 08:55:21 · 342 阅读 · 0 评论