【二分图】
riba2534
没有谁生来就是神牛,而千里之行,始于足下!
展开
-
NYOJ1015 二部图(染色法判断二分图)
描述 二部图又叫二分图,我们不是求它的二分图最大匹配,也不是完美匹配,也不是多重匹配,而是证明一个图是不是二部图。证明二部图可以用着色来解决,即我们可以用两种颜色去涂一个图,使的任意相连的两个顶点颜色不相同,切任意两个结点之间最多一条边。为了简化问题,我们每次都从0节点开始涂色输入 多组数据 第一行一个整数 n(n<=200) 表示 n个节点 第二行一个整数m 表示 条边 随后 m行 两个原创 2017-09-24 01:00:01 · 2493 阅读 · 3 评论 -
HDU3829 Cat VS Dog(二分图最大独立集)
Problem Description 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原创 2017-11-16 21:26:52 · 434 阅读 · 0 评论 -
POJ2594 Treasure Exploration(二分图最小路径覆盖,传递闭包)
Description Have you ever read any book about treasure exploration? Have you ever see any film about treasure exploration? Have you ever explored treasure? If you never have such experiences, y原创 2017-11-16 20:04:50 · 502 阅读 · 0 评论 -
HDU1511 Air Raid(二分图,最小路径覆盖)
Problem Description Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an intersection and walking thr原创 2017-11-16 19:31:37 · 540 阅读 · 0 评论 -
HDU1054 Strategic Game(二分图最小点集覆盖,König定理)
Problem Description Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following proble原创 2017-11-16 18:48:07 · 362 阅读 · 0 评论 -
POJ2289 Jamie's Contact Groups(二分图多重匹配+二分)
Description Jamie is a very popular girl and has quite a lot of friends, so she always keeps a very long contact list in her cell phone. The contact list has become so long that it often takes原创 2017-11-21 19:51:48 · 684 阅读 · 0 评论 -
POJ3020 Antenna Placement(二分图最小路径覆盖)
Description The Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most striking reason why they got the job, is their原创 2017-11-16 14:17:33 · 406 阅读 · 0 评论 -
HDU4185 Oil Skimming(二分图匹配,匈牙利算法)
Problem Description Thanks to a certain “green” resources company, there is a new profitable industry of oil skimming. There are large slicks of crude oil floating in the Gulf of Mexico just wa原创 2017-11-16 01:24:25 · 460 阅读 · 0 评论 -
HDU2819 Swap(二分图匹配匈牙利算法+记录路径)
Problem Description Given an N*N matrix with each entry equal to 0 or 1. You can swap any two rows or any two columns. Can you find a way to make all the diagonal entries equal to 1?Input Th原创 2017-11-16 00:22:18 · 414 阅读 · 0 评论 -
HDU1281 棋盘游戏(匈牙利算法,暴力)
Problem Description 小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下,棋盘里有些格原创 2017-11-14 20:42:08 · 355 阅读 · 0 评论 -
HDU1803 Courses(二分图匹配,匈牙利算法,dfs)
Problem Description Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible to form a committee of原创 2017-11-14 16:34:04 · 374 阅读 · 0 评论 -
HDU3488 Tour(二分图最小完备匹配,KM算法,转化思想)
Problem Description In the kingdom of Henryy, there are N (2 <= N <= 200) cities, with M (M <= 30000) one-way roads connecting them. You are lucky enough to have a chance to have a tour in the原创 2017-11-18 19:52:58 · 560 阅读 · 0 评论 -
HDU2255 奔小康赚大钱(二分图的最大完备匹配,KM算法)
Problem Description 传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。 这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只能得到一间房子。 另一方面,村长和另外的村领导希望得到最大的效益,这样村里的机构才会有钱.原创 2017-11-18 19:18:24 · 337 阅读 · 0 评论 -
HDU2444 The Accomodation of Students(二分图匹配,匈牙利算法,DFS)
Problem Description There are a group of students. Some of them may know each other, while others don’t. For example, A and B know each other, B and C know each other. But this may not imply th原创 2017-11-13 20:52:57 · 337 阅读 · 0 评论 -
Codeforces Round #435 (Div. 2)B. Mahmoud and Ehab and the bipartiteness(二分图,染色法)
题目:B. Mahmoud and Ehab and the bipartitenesstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMahmoud原创 2017-09-24 01:35:08 · 403 阅读 · 0 评论 -
POJ2239 Selecting Courses(二分图匹配,匈牙利算法)
Description It is well known that it is not easy to select courses in the college, for there is usually conflict among the time of the courses. Li Ming is a student who loves study every much,原创 2017-12-02 18:07:56 · 405 阅读 · 0 评论