#P3386. 【模板】二分图最大匹配
【模板】二分图最大匹配
Description
Given a bipartite graph with left vertices, right vertices, and edges, find the size of its maximum matching.
The left vertices are numbered from to , and the right vertices are numbered from to .
Input Format
The first line contains three integers, representing , , and .
The next lines each contain two integers , indicating that there is an edge connecting left vertex and right vertex .
Output Format
Output a single integer on one line, representing the size of the maximum matching of the bipartite graph.
1 1 1
1 1
1
4 2 7
3 1
1 2
3 2
1 1
4 2
4 1
1 1
2
Hint
Constraints
For all test points, it is guaranteed that:
- .
- .
- , .
The given graph is not guaranteed to be free of multiple edges.
Translated by ChatGPT 5
京公网安备 11011102002149号