
------图论------
baodream
这个作者很懒,什么都没留下…
展开
-
HDU 2236 无题II(二分图匹配+二分)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2236Problem Description这是一个简单的游戏,在一个n*n的矩阵中,找n个数使得这n个数都在不同的行和列里并且要求这n个数中的最大值和最小值的差值最小。 Input输入一个整数T表示T组数据。对于每组数据第一行输入一个正整数n(1<=n<=100)表示矩阵的大小。接着输入n...原创 2018-04-30 21:40:22 · 221 阅读 · 0 评论 -
poj 3686 The Windy's(KM算法)
题目链接:http://poj.org/problem?id=3686DescriptionThe Windy's is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receives N orders for toys. The manager knows...原创 2018-04-30 20:50:09 · 170 阅读 · 0 评论 -
POJ 2195 Going Home(二分图最小匹配,KM算法)
题目链接:http://poj.org/problem?id=2195DescriptionOn a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, to an a...原创 2018-04-30 19:45:51 · 201 阅读 · 0 评论 -
POJ 3565 Ants(二分图最小权匹配,KM算法)
题目链接:http://poj.org/problem?id=3565DescriptionYoung naturalist Bill studies ants in school. His ants feed on plant-louses that live on apple trees. Each ant colony needs its own apple tree to feed its...原创 2018-04-30 18:24:31 · 300 阅读 · 0 评论 -
HDU 2255 奔小康赚大钱(KM算法)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2255Problem Description传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只能得到...原创 2018-04-25 20:30:29 · 170 阅读 · 0 评论 -
POJ 3041 Asteroids(二分图匹配)
题目链接:http://poj.org/problem?id=3041DescriptionBessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroi...原创 2018-04-24 20:07:00 · 159 阅读 · 0 评论 -
POJ 1469 COURSES(二分图匹配)
题目链接:http://poj.org/problem?id=1469DescriptionConsider 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 ...原创 2018-04-24 17:42:53 · 151 阅读 · 0 评论 -
HDU 2389 Rain on your Parade(二分图匹配的hopcroft-carp算法)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2389Problem DescriptionYou’re giving a party in the garden of your villa by the sea. The party is a huge success, and everyone is here. It’s a warm, sunn...原创 2018-04-24 17:04:44 · 317 阅读 · 0 评论 -
HDU 2063 过山车 (二分图最大匹配)
题目链接:http://acm.hdu.edu.cn/viewcode.php?rid=24466075Problem DescriptionRPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把,Rabbit只愿意和XHD或P...原创 2018-04-22 21:06:25 · 187 阅读 · 0 评论 -
Codeforces 33B. String Problem(Floyd最短路)
题目链接:http://codeforces.com/contest/33/problem/BBoy Valera likes strings. And even more he likes them, when they are identical. That's why in his spare time Valera plays the following game. He takes an...原创 2018-05-11 21:10:00 · 612 阅读 · 0 评论 -
POJ 3268 Silver Cow Party
题目链接:链接传送门题目大意:有编号为1-N的牛,它们之间存在一些单向的路径。给定一头牛的编号,其他牛要去拜访它并且拜访完之后要返回自己原来的位置,求这些牛中所花的最长的来回时间是多少。开始跑Floyd,想的是把所有点跑出来,超时了百度大牛博客,反向建图,这操作,行吧,反向建图一次,跑两次Dijkstra附上不优秀代码:#include#include#include#i原创 2018-01-31 15:36:44 · 154 阅读 · 0 评论