注释应该比较清楚了吧= =#include
#include
#include
#include
#include
#define MAXN 2048
#define MAXINT 0x7fffffff
using namespace std;
int n,m;//点的数目和边的数目
int dis[MAXN+1];//距离标号
int num[MAXN+1];
int src,des;//sr...
分类:
编程语言 时间:
2015-02-09 09:26:18
阅读次数:
206
今天学习了一下ISAP算法,简单的进行了网络流的实现。cogs885 草地排水题目大意:赤裸裸的网络流模板题。#include#includeusing namespace std;int map[201][201]={0},dis[201]={0},gap[201]={0},pre[201]={0...
分类:
其他好文 时间:
2015-02-08 12:44:52
阅读次数:
131
Dining
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 9938
Accepted: 4567
Description
Cows are such finicky eaters. Each cow has a preference for certai...
分类:
编程语言 时间:
2015-01-19 09:22:19
阅读次数:
208
Power Network
Time Limit: 2000MS
Memory Limit: 32768K
Total Submissions: 23724
Accepted: 12401
Description
A power network consists of nodes (power stations, consum...
分类:
编程语言 时间:
2015-01-18 17:14:54
阅读次数:
255
Drainage Ditches
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 58538
Accepted: 22485
Description
Every time it rains on Farmer John's fields, a pond fo...
分类:
编程语言 时间:
2015-01-18 13:12:01
阅读次数:
291
最近大三学生让我去讲课,我就恶补了最大流算法,笔者认为最重要的是让学弟学妹们入门,知道算法怎么来的?为什么是这样?理解的话提出自己的改进,然后再看看Dinic、SAP和ISAP算法…..一、概念引入 首先要先清楚最大流的含义,就是说从源点到经过的所有路径的最终到达汇点的所有流量和。 流网络G=(V....
分类:
编程语言 时间:
2014-12-25 21:45:39
阅读次数:
190
这两天学习了网络流,下面是ISAP算法模板:
const int inf = 0x3fffffff;
template
struct Isap
{
int top;
int d[N], pre[N], cur[N], gap[N];
struct Vertex{
int head;
} V[N];
struct Edge{...
分类:
其他好文 时间:
2014-05-26 04:10:16
阅读次数:
252