diff options
| author | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-11-16 17:48:10 +0100 |
|---|---|---|
| committer | Gloria Mundi <gloria@gloria-mundi.eu> | 2024-11-16 18:01:53 +0100 |
| commit | e55df069a8f83b2c0c2b56c035f49e89516cdaaa (patch) | |
| tree | dd6767e3fc6ac8532661dc75886a3056804d1d46 /content/graph/hopcroftKarp.cpp | |
| parent | 72bd993483453ed8ebc462f1a33385cd355d486f (diff) | |
minor fixes, let code breathe where possible
Diffstat (limited to 'content/graph/hopcroftKarp.cpp')
| -rw-r--r-- | content/graph/hopcroftKarp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/content/graph/hopcroftKarp.cpp b/content/graph/hopcroftKarp.cpp index c1f5d1c..7c0fec5 100644 --- a/content/graph/hopcroftKarp.cpp +++ b/content/graph/hopcroftKarp.cpp @@ -5,14 +5,14 @@ vector<int> pairs, dist, ptr; bool bfs(int l) { queue<int> q; for(int v = 0; v < l; v++) { - if (pairs[v] < 0) {dist[v] = 0; q.push(v);} + if (pairs[v] < 0) { dist[v] = 0; q.push(v); } else dist[v] = -1; } bool exist = false; while(!q.empty()) { int v = q.front(); q.pop(); for (int u : adj[v]) { - if (pairs[u] < 0) {exist = true; continue;} + if (pairs[u] < 0) { exist = true; continue; } if (dist[pairs[u]] < 0) { dist[pairs[u]] = dist[v] + 1; q.push(pairs[u]); |
