http://acm.hrbeu.edu.cn/index.php?act=problem&id=1001&cid=19View Code #include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int maxn = 100010;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1int ok[maxn<<2];void build(int l,int r,int Read More
posted @ 2012-03-15 21:32
Because Of You
Views(386)
Comments(0)
Diggs(0)
先判断有无可行流,再求最大流http://blog.csdn.net/fp_hzq/article/details/6772320在上一题上下界流中,我们已经知道了怎么判断无源汇上下界网络流有无可行流把每一天看成一个点,每个女孩也看成一个点,增加源和汇s、t,源向每一天连上[0,d]的边,每一天与每个女孩如果有拍照任务的话连上[l,r]的边,每个女孩与汇连上[g,oo]的边,于是构成一个有上下界的图所以这道题目我们可以转换一下只要连一条T → S的边,流量为无穷,没有下界,那么原图就得到一个无源汇的循环流图。接下来的事情一样:原图中的边的流量设成自由流量ci – bi。新建源点SS汇点TT,求 Read More
posted @ 2012-03-15 19:41
Because Of You
Views(1246)
Comments(0)
Diggs(0)