飞行员配对方案问题(匈牙利算法+sort)


洛谷传送门

匈牙利算法+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



上一篇:树状数组 &amp;&amp; 线段树

下一篇:NOIP2009T3最优贸易(Dfs + spfa)


stl 二分图 最大匹配 最大流 网络流 匈牙利算法
Copyright © 2002-2019 k262电脑网 www.k262.cn 皖ICP备2020016292号
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!QQ:251442993 热门搜索 网站地图