Files
teamnote/2024fall/source/Graph/BipartiteMatching.cpp
2026-06-03 09:36:52 +09:00

17 lines
290 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;
}