题目链接 上下界费用流: /* 每个点i恰好(最少+最多)经过一次->拆点(最多)+限制流量下界(i,i',[1,1],0)(最少) 然后无源汇可行流 不需要源汇. 注: SS只会连i',求SS->TT的最大流 该走的i->i'是不会不走的 */ #include<queue> #include<cstdio> #include<cctype> #include<cstring> #include<algorithm> #def…
题目链接: http://acm.sgu.ru/problem.php?contest=0&problem=194 题目大意: n个点(n<20000!!!不是200!!!RE了无数次),m条边(管子)(m范围好像没说,我开了10^6),每个点流入的和流出的液体要相等,每条边(管子)有上下界流量,问是否有解,有解YES无解NO,有解还要输出每条边的流量. 题目输入样例略坑,我以为要多组数据输入输出TEST #1 什么的.后来仔细看了Input发现只有一组吧应该,保险起见还是写了多组,但是不用…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2314 The terrorist group leaded by a well known international terrorist Ben Bladen is buliding a nuclear reactor to produce plutonium for the nuclear bomb they are planning to create.…
Destroy Transportation system Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)http://acm.hdu.edu.cn/showproblem.php?pid=4940 Problem Description Tom is a commander, his task is destroying his enemy’s transportatio…
Reactor Coolinghttp://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1314 Time Limit: 5 Seconds      Memory Limit: 32768 KB      Special Judge The terrorist group leaded by a well known international terrorist Ben Bladen is buliding a nuclear re…
题意:看是否有无源汇上下界可行流,如果有输出流量 题解:对于每一条边u->v,上界high,下界low,来说,我们可以建立每条边流量为high-low,那么这样得到的流量可能会不守恒(流入量!=流出量),这时我们要想使得流量守恒,我们需要建立附加流,附加流 是在刚才的图上的改进流,对于每一个点如果有流入量(in)>流出量(out),那么对于多余的流入量,我们需要想办法新加一条边流量为in-out流入该点,反之如果in<out,那么需要建立一条边流量为out-in流出该点,我们此时可以建立…
The terrorist group leaded by a well known international terrorist Ben Bladen is buliding a nuclear reactor to produce plutonium for the nuclear bomb they are planning to create. Being the wicked computer genius of this group, you are responsible for…
题目链接: http://www.lydsy.com:808/JudgeOnline/problem.php?id=3876 题目大意: 给定一张拓扑图(有向无环图),每条边有边权,每次只能从第一个点出发沿着拓扑图走一条路径,求遍历所有边所需要的最小边权和. 题目思路: [有源汇上下界费用流] Orz两位神犇,以下思路借鉴自 http://hzwer.com/6224.html http://blog.csdn.net/popoqqq/article/details/43024221 建图如下:…
1927: [Sdoi2010]星际竞速 题意:一个带权DAG,每个点恰好经过一次,每个点有曲速移动到他的代价,求最小花费 不动脑子直接上上下界费用流过了... s到点连边边权为曲速的代价,一个曲速移动等价于走到t再从s重新开始 搜了下题解发现全是普通费用流... 源向i+n连容量1,费用为能力爆发的费用 源向i连容量1,费用为0 i+n向汇连容量1,费用0 如果有边x<y,连x到y+n容量为1,费用为时间 和最小路径覆盖很像,只是连到i+n有权值 *** #include <iostream…
1927: [Sdoi2010]星际竞速 Time Limit: 20 Sec  Memory Limit: 259 MBSubmit: 2051  Solved: 1263[Submit][Status][Discuss] Description 10年一度的银河系赛车大赛又要开始了.作为全银河最盛大的活动之一,夺得这个项目的冠军无疑是很多人的梦想,来自杰森座α星的悠悠也是其中之一.赛车大赛的赛场由N颗行星和M条双向星际航路构成,其中每颗行星都有一个不同的引力值.大赛要求车手们从一颗与这N颗行…