【BZOJ1834】网络扩容(最大流,费用流) 题面 Description 给定一张有向图,每条边都有一个容量C和一个扩容费用W。这里扩容费用是指将容量扩大1所需的费用。求: 1、 在不扩容的情况下,1到N的最大流; 2、 将1到N的最大流增加K所需的最小扩容费用。 Input 输入文件的第一行包 ...
分类:
其他好文 时间:
2017-12-29 15:20:26
阅读次数:
124
参考:https://www.cnblogs.com/chenyushuo/p/5144957.html 不得不说这个建图方法真是非常妙啊 假设S点选理,T点选文,a[i][j]为(i,j)选文收益,b[i][j]为(i,j)选理收益,c[i][j]为同时选文收益,d[i][j]为同时选文收益。 那 ...
分类:
移动开发 时间:
2017-12-28 12:01:49
阅读次数:
621
#include<bits/stdc++.h>const int maxn=100008;using namespace std;int read(){ char ch=getchar();int f=1,w=0; while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=g ...
分类:
其他好文 时间:
2017-12-25 00:58:37
阅读次数:
151
```cpp include include include include using namespace std; struct Edge{ int too, nxt, val, lim; }edge[60005]; int n, m, ss, tt, sss, ttt, hea[255], c ...
分类:
其他好文 时间:
2017-12-24 20:10:57
阅读次数:
184
http://www.lydsy.com/JudgeOnline/problem.php?id=1001 解法1:直接最小割dinic || isap ,据说会卡掉某些人写的丑的dinic /****************************************************** ...
分类:
其他好文 时间:
2017-12-24 11:12:03
阅读次数:
100
``` include include include define N 1000005 define inf 0x3f3f3f3f using namespace std; struct node{ int to,nxt,cap; }; int que[N]; int h,qt; struct D ...
分类:
移动开发 时间:
2017-12-23 15:51:42
阅读次数:
160
``` include include include define N 1000005 define inf 0x3f3f3f3f using namespace std; struct node{ int to,nxt,cap; }; int que[N]; int h,qt; struct D ...
分类:
其他好文 时间:
2017-12-23 14:13:21
阅读次数:
174
luogu 匈牙利算法 cpp include include include using namespace std; int n, m, uu, vv, e, lnk[1005], ans; bool a[1005][1005], vis[1005]; bool dfs(int u){ for( ...
分类:
编程语言 时间:
2017-12-21 23:06:40
阅读次数:
198
dinic cpp include include include include using namespace std; struct Edge{ int too, nxt, val; }edge[200005]; int n, m, uu, vv, ww, cnt=0, maxFlow, he ...
分类:
其他好文 时间:
2017-12-20 21:53:22
阅读次数:
178