![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论
文章平均质量分 73
Piink
博主已停更
展开
-
Swap HDU - 2819(二分图最大匹配)
Given an N*N matrix with each entry equal to 0 or 1. You can swap any two rows or any two columns. Can you find a way to make all the diagonal entries equal to 1?InputThere are several test cases in the input. The first line of each test case is an integ原创 2021-08-13 10:31:07 · 131 阅读 · 0 评论 -
Pseudoforest HDU - 3367(最大生成树+kruskal算法+并查集+判环)
In graph theory, a pseudoforest is an undirected graph in which every connected component has at most one cycle. The maximal pseudoforests of G are the pseudoforest subgraphs of G that are not contained within any larger pseudoforest of G. A pesudoforest i原创 2021-07-28 21:03:17 · 381 阅读 · 0 评论 -
50 years, 50 colors HDU - 1498(二分图最大匹配)
On Octorber 21st, HDU 50-year-celebration, 50-color balloons floating around the campus, it’s so nice, isn’t it? To celebrate this meaningful day, the ACM team of HDU hold some fuuny games. Especially, there will be a game named “crashing color balloons”.原创 2021-07-28 15:06:35 · 119 阅读 · 0 评论 -
最小生成树总结(Kruskal算法+Prim算法)
最小生成树(或称为最小代价生成树)对无向连通图的生成树,各边的权值总和称为生成树的权,权最小的生成树称为最小生成树。构成最小生成树的三条准则:1.必须只使用该网络中的边来构造最小生成树2.必须使用且仅使用n-1条边来联结网络中的n个顶点3.不能使用产生回路的边常用的构造最小生成树算法:克鲁斯卡尔(Kruskal)算法,普里姆(Prim)算法克鲁斯卡尔算法算法思想:以边为主导地位,始终都是选择当前可用的最小权值的边。实现步骤:从网络中选择权值最小的边,将所有边的信息存放到一个结构体中,并原创 2021-05-18 09:57:58 · 1309 阅读 · 0 评论