摘要:一.最小生成树:连通N个点的边权值总和最小的树。 二.时间复杂度 Prim算法:时间复杂度O(|V|2+|E|),O(|E|log|V|) Kruskal算法:时间复杂度O(|E|log|E|) 算法的选择: 从图的稀疏程度考虑(稠密图Prim,稀疏图Kruskal或Prim + Heap) 三.具
阅读全文
摘要:H - 最小生成树模板+1(适合Prim) UVA - 10369 The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two diff
阅读全文
摘要:G - 最小生成树模板(适合Kruskal) UVALive - 2515 You are assigned to design network connections between certain points in a wide area. You are given a set of poi
阅读全文
摘要:UVA - 11987 Almost Union-Find I hope you know the beautiful Union-Find structure. In this problem, you’re to implement something similar, but not iden
阅读全文
摘要:POJ - 2492 http://poj.org/problem?id=2492 Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that th
阅读全文
摘要:J - Chores POJ - 1949 Farmer John's family pitches in with the chores during milking, doing all the chores as quickly as possible. At ...
阅读全文
摘要:E - Longest Regular Bracket Sequence CodeForces - 5C This is yet another problem dealing with regular bracket sequences.We should remi...
阅读全文