diff options
| author | MZuenni <michi.zuendorf@gmail.com> | 2023-03-01 11:36:26 +0100 |
|---|---|---|
| committer | MZuenni <michi.zuendorf@gmail.com> | 2023-03-01 11:36:26 +0100 |
| commit | 12afe719ce268bb10aa93a910079a44eb08999b8 (patch) | |
| tree | 0937a117287eebe3942e0506d27143eff4980d09 /graph/dinicScaling.cpp | |
| parent | ad8456f7c5d44d3c647b3a368050a5d2f39ae3c3 (diff) | |
removed trailing whitespaces and use more structured bindings
Diffstat (limited to 'graph/dinicScaling.cpp')
| -rw-r--r-- | graph/dinicScaling.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/graph/dinicScaling.cpp b/graph/dinicScaling.cpp index 5dc06d6..aecbddc 100644 --- a/graph/dinicScaling.cpp +++ b/graph/dinicScaling.cpp @@ -1,5 +1,5 @@ struct edge { - int from, to; + int from, to; ll f, c; }; @@ -19,7 +19,7 @@ void addEdge(int from, int to, ll c) { bool bfs() { dist.assign(sz(dist), -1); - dist[t] = sz(adjlist) + 1; + dist[t] = sz(adjlist) + 1; q.push(t); while (!q.empty() && dist[s] < 0) { int cur = q.front(); q.pop(); @@ -39,7 +39,7 @@ bool dfs(int v, ll flow) { if (v == t) return true; for (; pt[v] < sz(adjlist[v]); pt[v]++) { int id = adjlist[v][pt[v]], to = edges[id].to; - if (dist[to] == dist[v] + 1 && + if (dist[to] == dist[v] + 1 && edges[id].c - edges[id].f >= flow) { if (dfs(to, flow)) { edges[id].f += flow; |
