USACO Section 4.2 The Perfect Stall(二分图匹配)

二分图的最大匹配。我是用最大流求解。加个源点s和汇点t;s和每只cow、每个stall和t 连一条容量为1有向边,每只cow和stall(that the cow is willing to produce milk in )也连一条容量为1的边。然后就用ISAP。 #include<cstdio> #include<cstring> #include<iostream> #include<alg
相关文章
相关标签/搜索