随笔分类 -  网络流

摘要:http://poj.org/problem?id=3041View Code #include <iostream>#include <cstdio>#include <cstring>using namespace std;int map[510][510] = {0};int match[510] = {0};int value[510] = {0};int n = 0;int m = 0;int x = 0;int y = 0;int find(int q){ for(int i = 1;i <= n; ++i) { if(value[i] = 阅读全文
posted @ 2012-03-14 22:13 LT-blogs 阅读(151) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=1273题意:有一些流水的水沟,求从起点1到达终点的最大水量,每条水沟都有一个最大流水量;思路:基础的网络流问题(EK算法),注意边的重复;View Code #include <iostream>#include <cstdio>#include <cstring>#include <queue>#define max 205using namespace std;int s[max][max] = {0};int n = 0;int m = 0;int a = 0;int b = 0;int 阅读全文
posted @ 2012-03-11 15:45 LT-blogs 阅读(162) 评论(0) 推荐(0)