*本题于2023/8/1增强了数据,之前提交的代码不重测。
Chen loves bipartite graph matching problems. As a cat, Chen also loves playing with woolen balls. So she thinks the graph should be dense.
And here's The Cute Cat Matching Problem:
Given a bipartite graph with

nodes and
%7D%7B2%7D)
edges, guaranteed that there are no edges between nodes

. There are no edges between nodes

too. Also, there's no edge between

(

) and

. If there's an edge between

(

) and

, then there will be no edge between

and

. That means the given graph
guarantees that there'll be exactly one edge between
)
and
)
.
Help Chen find the maximum matching of the given graph.
输入描述:
The first line contains one integer
(
), meanings the graph has
node.
For the next
lines, each line while contain
s, forms a
matrix
(
). If
, there will be an edge between node
and
.
输出描述:
One integer, means the maximum matching of the given graph.
备注:
In the first sample, match node

and

.
In the second sample, match node

and

,

and

,

and

.