Skip to content
Snippets Groups Projects
Commit 2ddde5ab authored by Bruno Freitas Tissei's avatar Bruno Freitas Tissei
Browse files

Add status for MCMF

parent 14f9db1d
No related branches found
No related tags found
No related merge requests found
...@@ -2,17 +2,18 @@ ...@@ -2,17 +2,18 @@
/// ///
/// Time: O(V^2 * E) /// Time: O(V^2 * E)
/// Space: O(V + E) /// Space: O(V + E)
///
/// Status: Tested (UVA10594,kattis/mincostmaxflow)
struct MinCostMaxFlow { struct MinCostMaxFlow {
struct Edge { int u, v, cap, cost; }; struct Edge { int u, v, cap, cost; };
int N;
vector<Edge> edges; vector<Edge> edges;
vector<vector<int>> adj; vector<vector<int>> adj;
vector<int> vis, dist, par, ind; vector<int> vis, dist, par, ind;
MinCostMaxFlow(int N) : MinCostMaxFlow(int N) :
N(N), vis(N), dist(N), par(N), ind(N), adj(N) {} vis(N), dist(N), par(N), ind(N), adj(N) {}
void add_edge(int u, int v, int cap, int cost) { void add_edge(int u, int v, int cap, int cost) {
adj[u].pb(edges.size()); adj[u].pb(edges.size());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment