Update graph/mcmf.cc
Signed-off-by: subcrip <contact@subc.rip>
This commit is contained in:
parent
bb5838b2e6
commit
75823a421e
|
@ -5,7 +5,7 @@ struct mcmf {
|
||||||
ll flow;
|
ll flow;
|
||||||
ll cost;
|
ll cost;
|
||||||
int rev;
|
int rev;
|
||||||
bool mark;
|
int mark;
|
||||||
};
|
};
|
||||||
|
|
||||||
vector<vector<edge>> edges;
|
vector<vector<edge>> edges;
|
||||||
|
@ -15,7 +15,7 @@ struct mcmf {
|
||||||
|
|
||||||
mcmf(int n) : edges(n + 1), dis(n + 1), vis(n + 1) {}
|
mcmf(int n) : edges(n + 1), dis(n + 1), vis(n + 1) {}
|
||||||
|
|
||||||
void add_edge(int from, int to, ll cap, ll cost, bool mark = false) {
|
void add_edge(int from, int to, ll cap, ll cost, int mark = 0) {
|
||||||
edges[from].push_back({ to, cap, 0, cost, int(edges[to].size()), mark });
|
edges[from].push_back({ to, cap, 0, cost, int(edges[to].size()), mark });
|
||||||
edges[to].push_back({ from, 0, 0, -cost, int(edges[from].size() - 1), mark });
|
edges[to].push_back({ from, 0, 0, -cost, int(edges[from].size() - 1), mark });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue