From bc7a54f2a10ff3bb76cf4920be53000264bad279 Mon Sep 17 00:00:00 2001 From: mzuenni Date: Tue, 29 Aug 2023 01:07:11 +0200 Subject: consistency --- graph/matching.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'graph/matching.cpp') diff --git a/graph/matching.cpp b/graph/matching.cpp index 613cabb..f059351 100644 --- a/graph/matching.cpp +++ b/graph/matching.cpp @@ -5,12 +5,12 @@ int max_matching() { int ans = 0; mat.assign(sz(adj), {}); for (int _ = 0; _ < I; _++) { - for (int i = 0; i < sz(adj); i++) { - mat[i].assign(sz(adj), 0); - for (int j : adj[i]) { - if (j < i) { - mat[i][j] = rand() % (MOD - 1) + 1; - mat[j][i] = MOD - mat[i][j]; + for (int v = 0; v < sz(adj); v++) { + mat[v].assign(sz(adj), 0); + for (int u : adj[v]) { + if (u < v) { + mat[v][u] = rand() % (MOD - 1) + 1; + mat[u][v] = MOD - mat[v][u]; }}} gauss(sz(adj), MOD); //LGS unten int rank = 0; -- cgit v1.2.3