图论
文章平均质量分 55
我爱AI_AI爱我
不爱
展开
-
运用邻接表 建边和遍历(模板)
void add_edge(int u,int v,int w1){ e[++cnt].to=v; e[cnt].w1=w1; e[cnt].next=head[u]; head[u]=cnt;} for(int i = 1; i <= n; i ++) //i == 1,表示从点1出发直接可以到达的点,i,j分别为起点和终点 {原创 2016-08-22 16:21:54 · 623 阅读 · 0 评论 -
拓扑图+ dp
题目:J: Meeting Time时间限制: 1 Sec 内存限制: 64 MB提交: 10 解决: 5[提交][状态][讨论版]题目描述Bessie and her sister Elsie want to travel from the barn to their favorite field, such that they leave at exactly th原创 2016-08-22 16:28:29 · 1171 阅读 · 0 评论 -
求最大二分匹配(模板)
另:注意最大独立子集 = 顶点数(一面的) - 最大二分匹配 Hopcroft-Carp算法这个算法比匈牙利算法的时间复杂度要小,大数据可以采用这个算法/* *********************************************二分图匹配(Hopcroft-Carp的算法)。初始化:g[][]邻接矩阵调用:res=MaxMatch(); Nx,Ny要初原创 2016-10-13 17:20:12 · 292 阅读 · 0 评论