
二分匹配
二分匹配
Wanidde
本人很懒,什么都没有留下 ^_^
展开
-
POJ 3692 - Kindergarten (最大团)
KindergartenTime Limit: 2000MS Memory Limit: 65536K Total Submissions: 7658 Accepted: 3777 DescriptionIn a kindergarten, there are a lot of kids. All girls of the kids know eac...原创 2018-08-09 15:25:06 · 168 阅读 · 0 评论 -
HDU 3829 - Cat VS Dog(最大独立集)
The zoo have N cats and M dogs, today there are P children visiting the zoo, each child has a like-animal and a dislike-animal, if the child's like-animal is a cat, then his/hers dislike-animal must b...原创 2018-08-10 17:33:21 · 272 阅读 · 0 评论 -
HDU 2119 - Matrix (二分匹配最小点集覆盖)
Give you a matrix(only contains 0 or 1),every time you can select a row or a column and delete all the '1' in this row or this column .Your task is to give out the minimum times of deleting all the '...原创 2018-08-10 11:44:22 · 227 阅读 · 0 评论 -
HDU 2063 - 过山车 (二分匹配模板题)
RPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把,Rabbit只愿意和XHD或PQK做partner,Grass只愿意和linle或LL做partner,PrincessSnow愿意和水域浪子或伪酷儿做partner。考虑...原创 2018-08-10 11:41:01 · 217 阅读 · 0 评论 -
HDU 1281 - 棋盘游戏 (二分匹配)
小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下,棋盘里有些格子是可以避开的,也就是说,不在这些格子上放车,也...原创 2018-08-10 11:36:18 · 230 阅读 · 0 评论 -
HDU 1068 - Girls and Boys (最大独立集)
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 r...原创 2018-08-09 15:40:02 · 158 阅读 · 0 评论 -
二分匹配 (匈牙利算法及模板)
二分匹配我认为其实就是m个女生,n个男生相互认识的在一起,求最大匹配成的对数。 二分匹配的时间复杂度是O(NM)相关概念:最大匹配数:最大匹配的匹配边的数目定理1:最大匹配数 = 最小点覆盖数(这是 Konig 定理) 定理2:最大独立集 = 顶点数 - 最小点覆盖数 定理3:最小路径覆盖数 = 顶点数 - 最大匹配数最大完全数:图中最大完全子图的顶点个数。独立...原创 2018-08-11 09:41:01 · 251 阅读 · 0 评论