
最小生成树
M_ercury_
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
洛谷 P1550 [USACO08OCT]打井Watering Hole
题目背景John的农场缺水了!!! 题目描述Farmer John has decided to bring water to his N (1 <= N <= 300) pastures which are conveniently numbered 1..N. He may bring water to a pasture either by building a well in that p原创 2017-04-19 21:43:15 · 734 阅读 · 1 评论 -
codevs 3287 货车运输
loi 44. 「Loi57 test 2017.4.22」老司机 2013年NOIP全国联赛提高组 时间限制: 1 s 空间限制: 128000 KB 题目描述 Description A 国有 n 座城市,编号从 1 到 n,城市之间有 m 条双向道路。每一条道路对车辆都有重量限制,简称限重。现在有 q 辆货车在运输货物,司机们想知道每辆车在不超过车辆限重的情况下,最多能运多重原创 2017-04-22 21:57:25 · 320 阅读 · 0 评论 -
codevs 1231 最优布线问题
//prim #include<iostream> #include<cstdio> #include<cstring> #include<vector> #include<queue> using namespace std; const int M=100000+50; vector<int> tu[M],cost[M]; int n,m,used[M],x,y,z; long long ans原创 2017-07-16 11:25:17 · 439 阅读 · 0 评论 -
10.20 课件题目练习 贪心+MST+最短路+划分DP
http://www.studyai.com/article/f70a01f9原创 2017-10-20 10:17:48 · 269 阅读 · 0 评论 -
bzoj 2654 tree
题目: http://www.lydsy.com/JudgeOnline/problem.php?id=2654 2654: tree Description给你一个无向带权连通图,每条边是黑色或白色。让你求一棵最小权的恰好有need条白色边的生成树。 题目保证有解。 Input第一行V,E,need分别表示点数,边数和需要的白色边数。 接下来E行,每行s,t,c,col表示这边的端点(原创 2017-10-09 16:18:49 · 427 阅读 · 0 评论 -
Codevs 3315 时空跳跃者的魔法
啦啦原创 2017-10-19 19:58:30 · 280 阅读 · 0 评论 -
10.22 2017-57级模拟题 二分+并查集+MST+递推+DP+毒瘤noip
http://www.studyai.com/article/77fdee9c原创 2017-10-22 17:26:01 · 336 阅读 · 0 评论 -
Codevs 1003 电话连线
题目 http://codevs.cn/problem/1003/题解 裸的prim 要用最裸最朴素的邻接矩阵做法,才能保证输出的边正确 因为在堆优化之后,只考虑了权值,选择那一条边和邻接矩阵的做法不一样考虑把堆优化中的排序,多加几个关键字 首先是权值 权值相同时,如果拓展的节点(t)不同,在矩阵做法中,拓展节点小的哪一个 拓展节点(t)也相同时,来源节点(s)不同, 在矩阵做法中,原创 2017-10-17 07:56:41 · 429 阅读 · 0 评论