图论
mars167
哇哦
展开
-
kruskal模版 [结构体存图]
kruskal的时间复杂度是O(eloge)。这里因为要给边排序,所以要用结构体存图。 然后用到了并查集检查两个点是否在同一连通分量里,以为在同一连通分量里的两个点如果链接一定形成了环,就不是树了。 #include <iostream> #include <vector> #include <string> #include <cstring> #include <algorithm> #inc原创 2017-03-27 22:01:06 · 359 阅读 · 0 评论 -
POJ 2378. Til the Cows Come Home [dijkstra模版] [邻接矩阵]
Language:Til the Cows Come Home Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 49872 Accepted: 16910 Description:Bessie is out in the field and wants to get back to the barn to原创 2017-03-21 19:46:12 · 181 阅读 · 0 评论 -
POJ-3268 Silver Cow Party[Dijkstra] [邻接矩阵] [置换矩阵]
Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 21046 Accepted: 9625 Description:One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big原创 2017-03-21 20:01:16 · 419 阅读 · 0 评论