Girls and Boys Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7681    Accepted Submission(s): 3518
原创 2023-04-24 09:49:28
417阅读
Girls and BoysTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8473Accepted Submission(s): 3893Pr...
转载 2015-07-22 09:27:00
73阅读
2评论
http://acm.hdu.edu.cn/showproblem.php?pid=1068Problem Descriptionthe second year of the university somebod...
转载 2019-05-30 16:34:00
49阅读
2评论
http://acm.hdu.edu.cn/showproblem.php?pid=1068Problem Descriptionthe second year of the university somebod...
转载 2019-05-30 16:34:00
113阅读
2评论
#include#include#includeusing namespace std;const int Max = 500;int num;int g[Max][Max];int linker[Max];bool used[Max];bool dfs(int u){ int v; for(v=0;v<num;v++) { if(g[u
原创 2022-08-05 15:52:37
12阅读
前边和后边性别不同!!!不然NP了 Girls and Boys Problem Description the second year of the university somebody started a study on the romantic relations between the
转载 2017-09-27 21:06:00
46阅读
找出没有缘分的同学,如果有缘分的建边,就是求最大独立集问题了 #include#includeint n,m,ma[1050][1050],mark[1050],link[1050];int find(int a){ int i; for(i=0;i<n;i++) { if(ma[a][i]==1&&mark[i]==0) { mark[i]=1; if(link[i]==-1||find(link[i])==1) { link[i]=a; ...
转载 2013-07-24 20:14:00
25阅读
2评论
原题链接 考察:二分图 思路: 求最大的集合,该集合内无边相连,即最大独立集.这里比较难把点分成二部分.我们可以直接不分,将每个点看成出度和入度,每条边(不相交)都等价于2个匹配.最后将匹配数$/2$即可. ##Code #include <iostream> #include <cstring> ...
转载 2021-07-14 17:43:00
44阅读
2评论
题目大意:n个同学,一些男女同学会有缘分成为情侣,格式ni:(m)n1n2n3表示同学ni有缘与n1,n2,n3成为情侣,求集合中不存在有缘成为情侣的同学的最大同学数。题解:图论知识:二分图最大独立集=总点数-二分图最大匹配,但是不知道同学的性别,所以将一个人同时看做女生和男生,就形成了二分图~#include #include #include using namespace std;const int N=505;int link[N],used[N];vector v[N];bool Dfs(int k){ for(int i=0;i<v[k].size();i++){ ...
转载 2014-03-26 13:45:00
62阅读
2评论
Girls and Boys Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10500 Accepted Submission(s): 48
原创 2021-07-21 15:27:24
257阅读
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1068思路:最大独立集 == |P| 减 【最大匹配(双向建图)】/2还是用的vector建邻接表。。。速度比较快。。。View Code 1 #include<iostream> 2 #include<vector> 3 const int N=507; 4 using namespace std; 5 int lx[N],ly[N]; 6 bool mark[N]; 7 vector<int>map[N]; 8 int n; 9 10 int dfs(int
转载 2013-04-04 17:44:00
70阅读
2评论
Girls and BoysTime Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3019Accepted Submission(s): 1294Problem Descriptionthe second year of the university somebody started a study on the romantic relations between the students. The relation “romantically
转载 2011-07-26 13:58:00
116阅读
2评论
Girls and BoysTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13556 Accepted Submission(s): 638
转载 2018-08-12 10:58:00
47阅读
HDU 1068 boys and girls(最大独立集)
原创 2022-11-17 00:00:36
31阅读
the second ye
原创 2022-12-02 00:20:55
102阅读
题目:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=19391Girls and BoysTime Limit: 10000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit Sta
原创 2022-08-09 19:27:57
53阅读
人拆成两个人进行最大匹配。由于一个拆成两个,所以最大匹配数应该是求出来的数
原创 2023-05-29 18:18:13
51阅读
Problem Description the second year of the university somebody started a study on the romantic relations between the students. The relation “romantica
转载 2020-08-11 21:06:00
104阅读
2评论
Girls and Boys Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7044 Accepted Submission(s): 31
转载 2017-05-18 19:29:00
156阅读
2评论
// Time 1062 ms, Memory 4252K#include #include int map[1010][1010],vis[1010],a[1010],b[1010],k; int f1(int u) { int v; for(v=0;v<k;v++) { if(map[u][v] && !vis[v]) { vis[v]=1; if(!b[v] || f1(b[v])) { a[u]=v;b[v]=u;return ...
转载 2013-06-11 16:32:00
29阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5