
最小生成树
最小生成树
Charon_HN
地摊炼丹大师、科研农民工、乡野程序员
展开
-
POJ 1251 优先队列+prim
题目链接题目大意:有n个村庄,每个村庄最多有15条路,并且村庄用字母表示,且由小到大给出,求最小的联通路径的花费 这是一道典型的最短路的模板题,在这里我就不用模板去写了,熟悉一下prim的队列优化来做#include<iostream>#include<cstdio>#include<cstdlib>#include<cstring...原创 2018-08-18 15:51:17 · 280 阅读 · 0 评论 -
poj -1679 次最小生成树
Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of...原创 2018-08-20 20:47:48 · 203 阅读 · 0 评论 -
POJ 1287 并查集 Kruskal或者Prim
You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect pairs of p...原创 2018-05-17 15:34:42 · 150 阅读 · 0 评论 -
poj 1751 并查集(prim)
The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware of this problem and has already constructed a numb...原创 2018-05-20 21:47:57 · 238 阅读 · 0 评论