Problem DescriptionIn the second year of the university somebody started a study on the romantic relations between the students. The relation "romantically involved" is defined between one girl and one boy. For the study reasons it is necessary…
题目描述: 给出一系列男女配对意愿信息.求一个集合中的最大人数,满足这个集合中两两的人不能配对. /* 二分图的最大独立集 因为没有给出具体的男生和女生,所以可以将数据扩大一倍,即n个男生,n个女生, 根据定理,最大独立集=总数-匹配数(本题应该除以2) */ #include<cstdio> #include<iostream> #include<cstring> #define N 510 using namespace std; int a[N][N],used[…
题目链接:http://poj.org/problem?id=1466 Girls and Boys Time Limit: 5000MS   Memory Limit: 10000K Total Submissions: 12026   Accepted: 5355 Description In the second year of the university somebody started a study on the romantic relations between the stu…
Girls and Boys Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8470    Accepted Submission(s): 3890 Problem Description the second year of the university somebody started a study on the romant…
最大独立集证明参考:https://blog.csdn.net/qq_34564984/article/details/52778763 最大独立集证明: 上图,我们用两个红色的点覆盖了所有边.我们证明的前提条件是已经达到最小覆盖. 即条件1.已经覆盖所有边,条件2.所用的点数最小 首先我们来证明蓝色点组成的是一个独立集:如果有两个蓝色点间有边相连,那么这条 边则没有被覆盖,则与条件1矛盾.因此是独立集. 再来证明这个独立集最大: 如果我们要再增加这个独立集中的点,则需要把某个红点变 成蓝点.而…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1068 Problem Description the second year of the university somebody started a study on the romantic relations between the students. The relation "romantically involved" is defined between one girl…
http://poj.org/problem?id=1466 Girls and Boys Time Limit: 5000MS   Memory Limit: 10000K Total Submissions: 11085   Accepted: 4956 Description In the second year of the university somebody started a study on the romantic relations between the students…
Girls and Boys Time Limit: 5000MS   Memory Limit: 10000K Total Submissions: 10912   Accepted: 4887 Description In the second year of the university somebody started a study on the romantic relations between the students. The relation "romantically in…
Girls and Boys Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://poj.org/problem?id=1466 Description In the second year of the university somebody started a study on the romantic relations between the students. The relation "romantically involved&q…
Girls and Boys Time Limit: 5000MS   Memory Limit: 10000K Total Submissions: 11097   Accepted: 4960 Description In the second year of the university somebody started a study on the romantic relations between the students. The relation "romantically in…
链接:poj 1466 题意:有n个学生,每一个学生都和一些人有关系,如今要你找出最大的人数.使得这些人之间没关系 思路:求最大独立集,最大独立集=点数-最大匹配数 分析:建图时应该是一边是男生的点,一边是女生的点连边.可是题目中没说性别的问题.仅仅能将每一个点拆成两个点.一个当作是男的点,一个当作是女的点了,然后连边.因为关系是相互的.这样就造成了边的反复.也就是边集是刚才的二倍,从而导致了最大匹配变成了原本的二倍.因此,此时最大独立集=点数-最大匹配数/2. #include<stdio.h…
Girls and Boys Time Limit: 5000ms Memory Limit: 10000KB This problem will be judged on PKU. Original ID: 1466 64-bit integer IO format: %lld      Java class name: Main In the second year of the university somebody started a study on the romantic(浪漫的)…
Girls and Boys Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://poj.org/problem?id=1466 Description In the second year of the university somebody started a study on the romantic relations between the students. The relation "romantically involved&q…
Girls and Boys Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) [Problem Description] the second year of the university somebody started a study on the romantic relations between the students. The relation “romant…
Girls and Boys Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7044    Accepted Submission(s): 3178 Problem Description the second year of the university somebody started a study on the roman…
解题报告 http://blog.csdn.net/juncoder/article/details/38160591 题目传送门(POJ) 题目传送门(HDU) 题意: 求满足条件的最大集合:集合内不论什么两个人都没有浪漫关系 思路: 跟POJ2771一样的题,变的简单多了.POJ2771解题报告 #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> us…
Girls and Boys Time Limit: 5000MS   Memory Limit: 10000K Total Submissions: 11694   Accepted: 5230 Description In the second year of the university somebody started a study on the romantic relations between the students. The relation "romantically in…
                                                            Girls and Boys Time Limit: 5000MS   Memory Limit: 10000K Total Submissions: 12192   Accepted: 5454 Description In the second year of the university somebody started a study on the romantic r…
Girls and BoysTime Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13556    Accepted Submission(s): 6385 Problem Descriptionthe second year of the university somebody started a study on the romanti…
题意: 有G个女孩,B个男孩.女孩彼此互相认识,男孩也彼此互相认识.有M对男孩和女孩是认识的.分别是(g1,b1),.....(gm,bm). 现在老师要在这G+B个小孩中挑出一些人,条件是这些人都互相认识.问最多可以挑出多少人. 思路: 女孩之间互相认识,男孩之间互相认识,所以我们可以将连边定义为:不认识.即:若两个节点之间有连边,则两个节点互不认识. 故题意即为选出最多的点使得这些点任意两点之间没有连边.即选最少的点覆盖所有边.(二分图最大独立集/二分图最小点覆盖) 代码: vector<i…
Girls and Boys Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5565    Accepted Submission(s): 2481 Problem Descriptionthe second year of the university somebody started a study on the romanti…
称号: Girls and Boys Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 189 Accepted Submission(s): 127   Problem Description the second year of the university somebody started a study on the romanti…
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…
Girls and Boys Time Limit: 5000MS   Memory Limit: 10000K Total Submissions: 12747   Accepted: 5678 Description In the second year of the university somebody started a study on the romantic relations between the students. The relation "romantically in…
Girls and Boys Time Limit: 5000ms Memory Limit: 10000KB This problem will be judged on PKU. Original ID: 146664-bit integer IO format: %lld      Java class name: Main     In the second year of the university somebody started a study on the romantic r…
Girls and Boys Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12246    Accepted Submission(s): 5768 Problem Description the second year of the university somebody started a study on the roma…
Girls and Boys Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7577    Accepted Submission(s): 3472 Problem Description the second year of the university somebody started a study on the romant…
题意:动物园有n只猫和m条狗,现在有p个小孩,他们有的喜欢猫,有的喜欢狗,其中喜欢猫的一定不喜欢狗,喜欢狗的一定不喜欢猫.现在管理员要从动物园中移除一些动物,如果一个小孩喜欢的动物留了下来而不喜欢的动物被移走,这个小孩会很高兴.现在问最多可以让多少个小孩高兴. 此题是求二分图最大独立集. 二分图比较明显,但是难在建图.这个题是找到最多的喜欢猫和喜欢狗而不互相冲突的小孩,这样我们将喜欢动物相互冲突的小孩之间连边,问题就变成了求二分图的最大独立集. 在二分图中,最大独立集=顶点数-最大匹配数. 求解…
Girls and Boys Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9245    Accepted Submission(s): 4240 Problem Description the second year of the university somebody started a study on the romant…
Cat VS Dog Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 125536/65536 K (Java/Others)Total Submission(s): 4039    Accepted Submission(s): 1458 Problem Description The zoo have N cats and M dogs, today there are P children visiting the zoo,…