题目地址:pid=4280">http://acm.hdu.edu.cn/showproblem.php? pid=4280 这个题是一个纯最大流模板题..就是用来卡时间的.. 还好我会isap算法..可是坑爹的是一直WA.最后加了个输入优化就过了...(不过把输入改了改而已. . )至今不知道为什么..请好心的看到此博客的大神赐教.. 代码例如以下: #include <iostream> #include <stdio.h> #include <strin…
题目地址:HDU 3667 这题的建图真是巧妙...为了保证流量正好达到k.须要让每一次增广到的流量都是1,这就须要把每一条边的流量都是1才行.可是每条边的流量并非1,该怎么办呢.这个时候能够拆边,反正c最多仅仅有5,拆成5条流量为1的边.可是这时候费用怎么办呢,毕竟平方的关系不能简单把每一条边加起来.这时候能够把拆的边的流量设为1,3,5,7,9.假设经过了3个流量,那就肯定会流1,3,5.费用为9,是3的平方,同理,其它的也是如此.然后依照给出的边建图跑一次费用流就能够了. 代码例如以下:…
题意: n岛m条路,然后是 n个岛的坐标,然后是m条双向路,包括 岛和 岛 之间 最大客流量,让求 最左边的岛 到右边的岛 最大客流量 分析: 建图 以 左边的岛为原点,最右边的为终点求最大客流量. 刘汝佳STL会超时,因为vector牵扯到 复制操作 然后看大神的将stl全换了http://www.cnblogs.com/xiao-xin/articles/4452306.html #include <iostream> #include <cstring> #include &…
HDU 4280 Island Transport(网络流,最大流) Description In the vast waters far far away, there are many islands. People are living on the islands, and all the transport among the islands relies on the ships. You have a transportation company there. Some route…
HDU 4289 Control (网络流,最大流) Description You, the head of Department of Security, recently received a top-secret information that a group of terrorists is planning to transport some WMD(Weapon of Mass Destruction)from one city (the source) to another o…
HDU 3416 Marriage Match IV (最短路径,网络流,最大流) Description Do not sincere non-interference. Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A and girls are in city B. Every time starvae can…
HDU 3605 Escape (网络流,最大流,位运算压缩) Description 2012 If this is the end of the world how to do? I do not know how. But now scientists have found that some stars, who can live, but some people do not fit to live some of the planet. Now scientists want you…
HDU 3338 Kakuro Extension (网络流,最大流) Description If you solved problem like this, forget it.Because you need to use a completely different algorithm to solve the following one. Kakuro puzzle is played on a grid of "black" and "white" ce…
POJ 2711 Leapin' Lizards / HDU 2732 Leapin' Lizards / BZOJ 1066 [SCOI2007]蜥蜴(网络流,最大流) Description Your platoon of wandering lizards has entered a strange room in the labyrinth you are exploring. As you are looking around for hidden treasures, one of…
HDU 4292 Food (网络流,最大流) Description You, a part-time dining service worker in your college's dining hall, are now confused with a new problem: serve as many people as possible. The issue comes up as people in your college are more and more difficult…