洛谷传送门
匈牙利算法+sort
没什么好说的。
——代码
1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 5 using namespace std; 6 7 int n, m, cnt, sum; 8 int next[10001], head[101], to[10001]; 9 bool vis[101]; 10 struct node 11 g[101]; 14 15 bool cmp(node x, node y) 16 19 20 void add(int x, int y) 21 26 27 bool find(int u) 28 42 } 43 } 44 return 0; 45 } 46 47 int main() 48 59 if(!sum) 60 64 printf("%d\n", sum); 65 sort(g + 1, g + n + 1, cmp); 66 for(i = 1; i <= n; i++) 67 71 return 0; 72 }View Code
上一篇:[HNOI2004]宠物收养场(Treap)
下一篇:双连通分量
二分图 匈牙利算法 stl 最大匹配 网络流 最大流









