POJ3692 Kindergarten 【最大独立集】】的更多相关文章

Kindergarten Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 5317   Accepted: 2589 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…
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…
Kindergarten Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 6882   Accepted: 3402 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 Kindergarten Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7371   Accepted: 3636 Description In a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know e…
=============================以下是最小生成树+并查集====================================== [HDU] How Many Tables 基础并查集★ 小希的迷宫 基础并查集★ &&poj1308 Is It A Tree? 基础并查集★ More is better 基础并查集★ Constructing Roads 基础最小生成树★ 畅通工程 基础并查集★ 还是畅通工程 基础最小生成树★ 畅通工程 基础最小生成树★ 畅通…
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…
[题目链接] http://poj.org/problem?id=3692 [题目大意] 男生相互之间都认识,女生相互之间也都认识, 一些男生和一些女生相互之间也认识,求找出最多的人参加派对, 他们相互之间都认识 [题解] 我们建认识图的反图,将相互之间不认识的连线, 那么问题转化为求这个图的最大独立集, 最大独立集答案为总点数减去最大匹配. [代码] #include <cstdio> #include <cstring> using namespace std; const i…
题意: 有G个女孩,B个男孩.女孩彼此互相认识,男孩也彼此互相认识.有M对男孩和女孩是认识的.分别是(g1,b1),.....(gm,bm). 现在老师要在这G+B个小孩中挑出一些人,条件是这些人都互相认识.问最多可以挑出多少人. 思路: 女孩之间互相认识,男孩之间互相认识,所以我们可以将连边定义为:不认识.即:若两个节点之间有连边,则两个节点互不认识. 故题意即为选出最多的点使得这些点任意两点之间没有连边.即选最少的点覆盖所有边.(二分图最大独立集/二分图最小点覆盖) 代码: vector<i…
题意:有男孩和女孩,男孩之间全部认识,女孩之间全部认识,一部分男孩和女孩认识,现在希望选出一些孩子,这些孩子都相互认识. 方法:正的做不好做,观察他的补图,补图之间无关系的边就是原图有关系的.补图中的独立集不正是相互都没有连边么,反过来说,它们在原图中不正是两两都有连边么. 最小割: #include<stdio.h> #include<string.h> #include<queue> #define INF 99999999 using namespace std;…
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…