Files
teamnote/source/Graph/BipartiteMatching.cpp
2026-06-03 09:20:51 +09:00

13 lines
284 B
C++

vector<int> sideadj[N];
int selby[M];
int chk[M], c;
bool matching(int s) {
for(auto i : sideadj[s]) {
if(chk[i] == c) continue;
chk[i] = c;
if(selby[i] and !matching(selby[i])) continue;
selby[i] = s;
return true;
}
return false;
}