teamnote history merge
This commit is contained in:
17
2024fall/source/Graph/BipartiteMatching.cpp
Normal file
17
2024fall/source/Graph/BipartiteMatching.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user