随笔分类 -  ACM_Uva

上一页 1 2

UVA 10048 Audiophobia 任意两点的路径上最大的边
摘要:题目是要求任意给定两点的的路径上最大的边,最终输出这些最大边中最小的值,也就是求一条路径使得这条路径上最大的边在所有连通两点的路径中最短。根据Floyd—Warshall算法改造一下就行了。dp[i][j]表示i,j两点的连通路径中最大边的最小值。 1 #include 2 #include 3 #define N 110 4 #define INF 999999999 5 #define max(a,b) ((a)>(b)?(a):(b)) 6 #define min(a,b) ((a)>(b)?(b):(a)) 7 8 int dp[N][N]; 9 int main(void 阅读全文

posted @ 2013-08-03 14:15 rootial 阅读(284) 评论(0) 推荐(0)

UVA 10034 Freckles 最小生成树
摘要:虽然是道普通的最小生成树题目,可还是中间出了不少问题,暴露的一个问题是不够细心,不够熟练。所以这篇博客就当记录一下bug吧。代码一:kruskal 1 #include 2 #include 3 #include 4 #include 5 #define N 110 6 7 typedef struct 8 { 9 double x,y; 10 } Point; 11 Point point[N]; 12 13 typedef struct 14 { 15 int u,v; 16 double c; 17 } EDGE; 18 EDGE edge[... 阅读全文

posted @ 2013-08-03 10:59 rootial 阅读(368) 评论(0) 推荐(0)

上一页 1 2

导航