1
0
Fork 0

Update graph/dinic.cc

Signed-off-by: subcrip <contact@subc.rip>
This commit is contained in:
subcrip 2024-05-19 13:25:39 +08:00
parent 42e20d7daf
commit c980791c94
1 changed files with 2 additions and 2 deletions

View File

@ -13,9 +13,9 @@ struct dinic {
dinic(int n) : edges(n + 1), layer(n + 1), vis(n + 1) {}
void add_edge(int from, int to, ll cap, int mark = 0) {
void add_edge(int from, int to, ll cap, int mark = 0, int mark_rev = 0) {
edges[from].push_back({ to, cap, 0, int(edges[to].size()), mark });
edges[to].push_back({ from, 0, 0, int(edges[from].size() - 1), mark });
edges[to].push_back({ from, 0, 0, int(edges[from].size() - 1), mark_rev });
}
bool bfs(int s, int t) {