图论
正义的地球人
这个作者很懒,什么都没留下…
展开
-
HDU 5222 Exploration 混合图判断是否成环
DescriptionMiceren likes exploration and he found a huge labyrinth underground! This labyrinth has caves and some tunnels connecting some pairs of caves. There are two types of tunnel,原创 2016-07-30 20:23:07 · 276 阅读 · 0 评论 -
uva 1151 Buy or Build 状压枚举
题目:不想给。题意:有n个网络站点,q张已经连好的网络子图,每个子图都有一定价格,连接了一些网络站点,最后给出n个点的坐标。现在想要连接这n个站点,可以买图,也可以自己修路(路的价格是两点距离的平方),求最小价格。解题思路:跑一遍不用套餐时的最小生成树,记录下加入生成树的边,然后二进制枚举所有套餐的使用情况,用完后套餐仍未连起来的点用第一次跑的最小生成树的边来连接,比较每种原创 2016-08-07 19:57:53 · 272 阅读 · 4 评论 -
HDU-3635 Dragon Balls
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3635题目大意:初始时,有n个龙珠,编号从1到n,分别对应的放在编号从1到n的城市中。现在又2种操作:T A B,表示把A球所在城市全部的龙珠全部转移到B城市。(第一次时,因为A球所在的城市只有一个球,所以只移动1个,如果有多个,则全部移动)。Q A,转载 2016-08-25 09:57:30 · 239 阅读 · 0 评论 -
hdu 3461 Code Lock(并查集+快速幂)
题目:A lock you use has a code system to be opened instead of a key. The lock contains a sequence of wheels. Each wheel has the 26 letters of the English alphabet 'a' through 'z', in order. If you m原创 2016-08-24 16:34:45 · 248 阅读 · 0 评论 -
HDU 4411 费用流,诡异的构图
There are (N+1) cities on TAT island. City 0 is where police headquarter located. The economy of other cities numbered from 1 to N ruined these years because they are all controlled by mafia. The poli原创 2016-08-23 21:38:30 · 340 阅读 · 0 评论 -
听说你会图论
=============================以下是最小生成树+并查集======================================【HDU】1213 How Many Tables 基础并查集★1272 小希的迷宫 基础并查集★1325&&poj1308 Is It A Tree? 基础并查集★1856 More is better转载 2016-08-16 20:33:42 · 695 阅读 · 0 评论 -
HDU 3225 Flowers Placement 二分图第k优解
DescriptionBytetown has a long tradition in organizing an international flower exhibition. Professor Feuerbach, a true flower lover, visited the exhibition this year. He was pleased by the most be原创 2016-08-15 11:15:36 · 319 阅读 · 0 评论 -
POJ 3680 Intervals 神奇的构图
DescriptionYou are given N weighted open intervals. The ith interval covers (ai, bi) and weighs wi. Your task is to pick some of the intervals to maximize the total weights under the limit tha原创 2016-08-09 21:35:48 · 295 阅读 · 0 评论 -
POJ3686 The Windy's 神奇的拆点
DescriptionThe 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 that every order will take d原创 2016-08-09 21:18:51 · 435 阅读 · 0 评论 -
POJ 2987 Firing 最大权闭合图
DescriptionYou’ve finally got mad at “the world’s most stupid” employees of yours and decided to do some firings. You’re now simply too mad to give response to questions like “Don’t you think it原创 2016-08-09 21:06:31 · 407 阅读 · 0 评论 -
POJ 2175 Evacuation Plan 费用流消圈算法
The City has a number of municipal buildings and a number of fallout shelters that were build specially to hide municipal workers in case of a nuclear war. Each fallout shelter has a limited capacity原创 2016-08-07 19:11:05 · 545 阅读 · 0 评论 -
POJ 2516 Minimum Cost 最大流的最小费用(不要拆点!)
DescriptionDearboy, a goods victualer, now comes to a big problem, and he needs your help. In his sale area there are N shopkeepers (marked from 1 to N) which stocks goods from him.Dearboy has M s原创 2016-08-07 11:21:55 · 306 阅读 · 0 评论 -
UVA 11419 SAM I AM 二分图+最小覆盖点
我不想给题目题意:给你一张二维图,上面有石头,然后你就用你TN的意大利炮去轰这些石头吧(意大利炮的威力很大,所以能够直线AOE),问你最少打几炮(只能横着或者竖着打)?输出打炮的位置。解题思路:题目等价于最多有多少个石头既不在同一行也不再同一列上。有石头的地方行和列就能匹配,找出最大匹配即可(匈牙利模板 )。然后是寻找打炮位置,看代码吧。。代码:#include#原创 2016-08-03 21:18:29 · 331 阅读 · 0 评论 -
POJ 3436ACM Computer Factory 最大流+路径输出 dinic模板
As you know, all the computers used for ACM contests must be identical, so the participants compete on equal terms. That is why all these computers are historically produced at the same factory.Ever原创 2016-08-03 21:02:09 · 616 阅读 · 0 评论 -
HDU 3696 SPFA算法
Description“Farm Game” is one of the most popular games in online community. In the community each player has a virtual farm. The farmer can decide to plant some kinds of crops like wheat or paddy原创 2016-07-31 11:12:20 · 348 阅读 · 0 评论 -
hdu 4786 Fibonacci Tree 思路
Description Coach Pang is interested in Fibonacci numbers while Uncle Yang wants him to do some research on Spanning Tree. So Coach Pang decides to solve the following problem: Consider a bid原创 2016-07-27 20:45:24 · 264 阅读 · 0 评论