
网络流
文章平均质量分 82
紫杉丶
这个作者很懒,什么都没留下…
展开
-
最小费用最大流
const int MAXN = 10000;const int MAXM = 100000;const int INF = 0x3f3f3f3f;struct Edge{ int to, next, cap, flow, cost;} edge[MAXM];int head[MAXN], tol;int pre[MAXN]; //储存前驱顶点int dis[MAXN];原创 2015-07-28 11:12:55 · 286 阅读 · 0 评论 -
ZOJ 3885 The Exchange of Items
最小费用最大流~。。 建图需要理解理解,其他都是模板#include #include #include #include #include #include #include #include #include #include using namespace std;typedef long long ll;const int MAXN = 10000;c原创 2015-07-28 09:02:02 · 658 阅读 · 0 评论 -
LightOJ 1153 Internet Bandwidth
On the Internet, machines (nodes) are richly interconnected, and many paths may exist between a given pair of nodes. The total message-carrying capacity (bandwidth) between two given nodes is the maxi原创 2015-07-19 18:53:56 · 366 阅读 · 0 评论 -
POJ 1149 PIGS
最大流,给定M个猪圈 N个商人 每个商人可以选择特定的猪圈买猪 当一个商人同时可以选择多个猪圈时,此时猪圈可以互通,就是此时两猪圈的流量上限为INF#include "cstring"#include "iostream"#include "cstdio"#include "queue"using namespace std;typedef long long LL;c原创 2015-07-19 18:59:35 · 271 阅读 · 0 评论 -
HDU 5294 Tricks Device (最短路+网络流)
题目要求: 至少删除多少条能破坏最短路 最多删除多少条边仍然存在最短路代码来源于:http://blog.youkuaiyun.com/u013532224/article/details/46992973#include #include #include #include #include #incl原创 2015-07-24 19:20:59 · 300 阅读 · 0 评论