随笔分类 - 图论——费用流
摘要:#include #include #include #include #include #include #include using namespace std;const int maxe = 100000;const int maxn = 205;const int INF = 0x3f3f3f3f;struct Edge{ int u,v,flow,cap,cost; int next; Edge(int u=0,int v=0,int flow=0,int cap=0,int cost=0,int next=0): u(u), v(v), flow...
阅读全文
摘要:#include #include #include #include #include #include #include using namespace std;const int maxe = 100000;const int maxn = 305;const int INF = 0x3f3f3f3f;int dist[maxn][maxn];int N,M,K;const int Max = 1000000;struct Edge{ int u,v,flow,cap,cost; int next; Edge(int u=0,int v=0,int flow=0,in...
阅读全文
摘要:题目链接:http://lightoj.com/volume_showproblem.php?problem=1198#include #include #include #include #include #include #include using namespace std;const int maxn = 150;const int maxe = 5000;const int INF = 0x3f3f3f;struct Edge{ int u,v,flow,cap,cost; int next; Edge(int u=0,int v=0,int flow=0,int...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4322#include #include #include #include #include #include #include using namespace std;const int maxe = 50000;const int maxn = 30;const int INF = 0x3f3f3f;struct Edge{ int u,v,flow,cap,cost; int next; Edge(int u=0,int v=0,int flow=0,int cap=0,...
阅读全文
摘要:由于暂时不会KM算法,只能用最大费用流来做了。题目链接:http://lightoj.com/volume_showproblem.php?problem=1011#include #include #include #include #include #include #include using namespace std;const int maxe = 50000;const int maxn = 500;const int INF = 0x3f3f3f;struct Edge{ int u,v,flow,cap,cost; int next; Edge(int u...
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2404#include #include #include #include #include #include #include #define maxn 550#define maxe 100000 #define INF 0x3f3f3fusing namespace std;struct Edge{ int from,to,cap,flow,cost; int next; void assign(int a,int b,int c,i...
阅读全文