XX生成树
D.Fu
试问岭南应不好,却道此心安处是吾乡
展开
-
poj-2377模板题,最大生成树
Bessie has been hired to build a cheap internet network among Farmer John's N (2 <= N <= 1,000) barns that are conveniently numbered 1..N. FJ has already done some surveying, and found M (1 <...原创 2018-09-16 10:10:50 · 407 阅读 · 0 评论 -
hdu——3367 并查集+最大生成树【模板】
题目链接:https://cn.vjudge.net/problem/HDU-3367 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 pse...原创 2018-09-16 12:20:55 · 158 阅读 · 0 评论 -
最小生成树-HDU1233 克鲁斯卡尔算法 模板
题意就是给你一个图,然后算这个图衍生的最小生成树 简直就是模板题 代码: #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int maxn=110; const int maxm=5e3...原创 2018-11-13 13:15:56 · 182 阅读 · 0 评论 -
poj 2485 最小生成树 Prim算法 模板
嗯,没错是纯模板,只要会模板就能ac的, 在这里还是讲一下模板的意思吧:大致就是现在起始点附近搜距离他最近的点v1,然后再以v1为点去搜距离v1最近的点,且之前都过的点不能再搜了,不明白的就去手画一下过程吧。 代码: #include<cstdio> #include<cstring> #include<algorithm> using namespa...原创 2018-11-13 13:19:51 · 152 阅读 · 0 评论