POJ 3692 Kindergarten(最大独立集)】的更多相关文章

Kindergarten Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 4903   Accepted: 2387 Description In a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition to that, some…
[题目链接] http://poj.org/problem?id=3692 [题目大意] 男生相互之间都认识,女生相互之间也都认识, 一些男生和一些女生相互之间也认识,求找出最多的人参加派对, 他们相互之间都认识 [题解] 我们建认识图的反图,将相互之间不认识的连线, 那么问题转化为求这个图的最大独立集, 最大独立集答案为总点数减去最大匹配. [代码] #include <cstdio> #include <cstring> using namespace std; const i…
Description In a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition to that, some girls and boys know each other. Now the teachers want to pick some kids to play a game, which n…
题意: 有G个女孩,B个男孩.女孩彼此互相认识,男孩也彼此互相认识.有M对男孩和女孩是认识的.分别是(g1,b1),.....(gm,bm). 现在老师要在这G+B个小孩中挑出一些人,条件是这些人都互相认识.问最多可以挑出多少人. 思路: 女孩之间互相认识,男孩之间互相认识,所以我们可以将连边定义为:不认识.即:若两个节点之间有连边,则两个节点互不认识. 故题意即为选出最多的点使得这些点任意两点之间没有连边.即选最少的点覆盖所有边.(二分图最大独立集/二分图最小点覆盖) 代码: vector<i…
Kindergarten Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 5660   Accepted: 2756 Description In a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition to that, some…
题目链接:http://poj.org/problem?id=3692 Description In a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition to that, some girls and boys know each other. Now the teachers want to pi…
Kindergarten Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 6956   Accepted: 3436 Description In a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition to that, some…
题意 幼稚园里有m个男孩和n个女孩(m.n范围都是[1,200]),男孩之间相互认识,女孩之间也相互认识,另外有部分男孩和女孩也认识.现在要举办一个活动,选取一些同学,要求所有选取的同学之间两两相互认识. 思路 抽象一下问题就是:在图G中选择一个最大的子图G'(V', E'),使得∑u, v∈V',  (u, v)∈E',这就是最大团问题,也即最大完全子图问题. 一般性的最大团问题是NP问题,但是此题的图比较特殊,有g个点互相相连,b个点也互相相连,也就是说他们的补图是一个二分图.那么我们就可以…
id=3692">Kindergarten Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 4920   Accepted: 2399 Description In a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition t…
题意:有G个女生,B个男生,所有的女生都互相认识,所有的男生都互相认识,还有N对男女,他们互相认识. 问从中选出最多的人数,是的他们全部互相认识. 思路:这道题的构图很巧妙,对于他的补图构图,对于所有互相认识的人,我们置Map[i][j] = 0 ,那么不认识的人置为1. 因为最大独立集中所有的点相互都没有边,即他们之间互相都认识,所以这道题就转化成了求最大独立集. 最大独立集=点数-最大匹配. CODE: #include <set> #include <map> #includ…