From 630a5bdf06d59b8340fb4bfc0e692cbcf094026a Mon Sep 17 00:00:00 2001 From: mzuenni Date: Thu, 10 Jul 2025 17:40:18 +0200 Subject: run with sanitizer --- content/graph/bitonicTSP.cpp | 2 +- content/graph/matching.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'content/graph') diff --git a/content/graph/bitonicTSP.cpp b/content/graph/bitonicTSP.cpp index eee5082..f025bca 100644 --- a/content/graph/bitonicTSP.cpp +++ b/content/graph/bitonicTSP.cpp @@ -1,6 +1,6 @@ vector> dist; // Initialisiere mit Entfernungen zwischen Punkten. -auto bitonicTSP() { +auto bitonicTSP() { // n >= 2! vector dp(sz(dist), HUGE_VAL); vector pre(sz(dist)); // nur für Tour dp[0] = 0; dp[1] = 2 * dist[0][1]; pre[1] = 0; diff --git a/content/graph/matching.cpp b/content/graph/matching.cpp index dcaea8c..1e450c0 100644 --- a/content/graph/matching.cpp +++ b/content/graph/matching.cpp @@ -1,4 +1,4 @@ -constexpr int MOD=1'000'000'007, I=10; +constexpr int mod=1'000'000'007, I=10; vector> adj, mat; int max_matching() { @@ -9,10 +9,10 @@ int max_matching() { 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]; + mat[v][u] = rand() % (mod - 1) + 1; + mat[u][v] = mod - mat[v][u]; }}} - gauss(sz(adj), MOD); //LGS @\sourceref{math/lgsFp.cpp}@ + gauss(sz(mat), sz(mat[0])); //LGS @\sourceref{math/lgsFp.cpp}@ int rank = 0; for (auto& row : mat) { if (*max_element(all(row)) != 0) rank++; -- cgit v1.2.3