博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[HDU] 1068 Girls and Boys(二分图最大匹配)
阅读量:4514 次
发布时间:2019-06-08

本文共 823 字,大约阅读时间需要 2 分钟。

题目地址:

本题求二分图最大独立点集。因为最大独立点集=顶点数-最大匹配数。所以转化为求最大匹配。因为没有给出男女,所以每个人都用了两遍,所以结果应该除以2。

1 #include
2 #include
3 #include
4 #include
5 #include
6 #include
7 #include
8 #include
9 #include
10 #include
11 #include
12 #include
13 #include
14 using namespace std;15 #define clr(x,y) memset(x,y,sizeof(x))16 #define sqr(x) ((x)*(x))17 #define rep(i,a,b) for(int i=(a);i<=(b);i++)18 #define LL long long19 #define INF 0x3f3f3f3f20 #define A first21 #define B second22 #define PI 3.1415926535897932323 const int N=2000+131;24 int n,m,f[N],g[N][N],link[N];25 26 void init()27 {28 clr(f,0);29 clr(g,0);30 clr(link,-1);31 }32 33 bool find(int x)34 {35 for(int i=0;i

 

转载于:https://www.cnblogs.com/sxiszero/p/4372869.html

你可能感兴趣的文章
vue基础
查看>>
django之vue跨域请求
查看>>
Windows环境安装tesseract-ocr 4.00并配置环境变量
查看>>
科聊——即时通信软件原型设计
查看>>
Iterator迭代器
查看>>
UIViewContentMode 的各种效果
查看>>
vim 使用、设置笔记
查看>>
hdu 3784 继续xxx定律
查看>>
浅谈MySQL存储引擎选择 InnoDB还是MyISAM
查看>>
命令行模式下获取参数的方法
查看>>
Java 异常体系
查看>>
iOS 9检测QQ、微信是否安装
查看>>
对Excel或者其他office操作推荐使用NPOI
查看>>
Java内部类、静态嵌套类、局部内部类、匿名内部类
查看>>
tp5 + layui 上传图片[支持单张和多张 ]
查看>>
黑苹果快捷键
查看>>
rsa.FromXmlString 系统找不到指定的文件
查看>>
PCB 电测试--测试点数自动输出到流程指示中(读取TGZ Stephdr文件)
查看>>
模型分离(选做)
查看>>
java 中的异步回调
查看>>