畅通project Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 37204 Accepted Submission(s): 19715 Problem Description 某省调查城镇交通状况.得到现有城镇道路统计表.表中列出了每条道路直接连通的城镇. 省政府"畅通project"的目标是使全省不论什么两个城镇间…
How Many Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 27455 Accepted Submission(s): 13656 Problem Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinn…
#include<iostream> #include<cstring> #include<cstdio> using namespace std; +; int p[N]; int w[N]; int find(int x) { if(p[x]==x) return x; int root=find(p[x]); w[x]+=w[p[x]]; p[x]=root; return p[x]; } int n,m; int main() { while(~scanf(&q…
How Many Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 27812 Accepted Submission(s): 13801 Problem Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinn…