From c980791c945017fa7000933805c4b5854c6a0881 Mon Sep 17 00:00:00 2001 From: subcrip Date: Sun, 19 May 2024 13:25:39 +0800 Subject: [PATCH] Update graph/dinic.cc Signed-off-by: subcrip --- graph/dinic.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graph/dinic.cc b/graph/dinic.cc index d638692..39d7be4 100644 --- a/graph/dinic.cc +++ b/graph/dinic.cc @@ -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) {