RT,在某个OJ上测出来第一种建边比第二种要快至少2倍。
请问网络流中第一种的建边是否真的比第二种建边要快?这又是什么原理呢?
vector<int>g[205];
struct edge {
int to,flow;
} e[10005];
int tot=1;
void addedge(int u,int v,int w) {
g[u].push_back(++tot);
e[tot].to=v;
e[tot].flow=w;
}
struct edge {
int to,nxt,flow;
} e[10005];
int tot=1,head[205];
void addedge(int u,int v,int w) {
e[++tot].to=v;
e[tot].flow=w;
e[tot].nxt=head[u];
head[u]=tot;
}