http://acm.split.hdu.edu.cn/showproblem.php?pid=1213 #include<stdio.h> #include<algorithm> #include<iostream> #include<string.h> using namespace std; ; int fa[maxn]; int fin(int x) { return fa[x]==x?fa[x]:fa[x]=fin(fa[x]); } int un…
How Many Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 13476 Accepted Submission(s): 6608 Problem Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinn…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1213 简单的并查集 代码: #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #define maxn 1100 using namespace std; int parent[maxn]; int m,n; int Find(int x) { int s; ;s=pa…