![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
joj acm_并查集
kongming_acm
kongming_acm
展开
-
2223: A Bug's Life
<br />2223: A Bug's LifeResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE10s8192K46199Standard<br />Background<br />Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that原创 2010-07-10 20:32:00 · 542 阅读 · 0 评论 -
2512: Groups
<br />2512: GroupsResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s16384K452121Standard<br />将N个人分成M组,测试数据包含多组输入,每组输入第一行为两个整数N,T(1<=N<=10000),(1<=T<=10000),后面有T行输入,每行两个整数a,b(1<=a,b<=N),表示编号为a的人和编号为b的人在同一组中,根据已知条件求组数M至多为多少。 Sample Input5 3 1 2 2 3 4 5原创 2010-07-10 20:32:00 · 373 阅读 · 0 评论 -
2639: Junk-Mail Filter
<br />#include<iostream><br />#include<string.h><br />#include<cstdio><br />using namespace std;<br />int fath[2300000],c[2300000],num[2300000];<br />int find(int x)<br />{<br /> return fath[x]==x?x:fath[x]=find(fath[x]);<br />}<br />void uion(int x,int y)原创 2010-07-10 20:33:00 · 474 阅读 · 0 评论 -
2203: Good and Bad
<br /> 2203: Good and BadResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K427126StandardThere are two types of professional wrestlers: "good guys" and "bad guys." Between any pair of professional wrestlers, there may or may not be a rivalry. Supose原创 2010-07-22 23:15:00 · 530 阅读 · 0 评论