232's competitive-programming templates./flows
-
HopcroftKarp232's competitive-programming templates./flows 2024. 10. 23. 13:25
struct HopcroftKarp { int n; int m; int match_cnt; std::vector lft; std::vector rgt; std::vector> adj; HopcroftKarp(int n, int m) : n(n), m(m), match_cnt(0), lft(n, -1), rgt(m, -1), adj(n) { void(0); } void addEdge(int u, int v) { assert(0 lvl(n, -1); std::vector que; for (int i = 0; i bool { for (int x : adj[u]) { if (rgt[x] == -1 || (lvl[rgt[x]] == lv..