diff --git a/content/graph/MinCostMaxFlow.h b/content/graph/MinCostMaxFlow.h index 23819ceed..7912797df 100644 --- a/content/graph/MinCostMaxFlow.h +++ b/content/graph/MinCostMaxFlow.h @@ -36,6 +36,7 @@ struct MCMF { void path(int s) { fill(all(seen), 0); fill(all(dist), INF); + par[s] = 0; dist[s] = 0; ll di; __gnu_pbds::priority_queue> q; diff --git a/stress-tests/graph/MinCostMaxFlow.cpp b/stress-tests/graph/MinCostMaxFlow.cpp index 17c96426b..d68f83c10 100644 --- a/stress-tests/graph/MinCostMaxFlow.cpp +++ b/stress-tests/graph/MinCostMaxFlow.cpp @@ -201,7 +201,42 @@ void testNeg() { cout<<"Tests passed!"<