随笔分类 -  最短路(Floyd||Dijkstra||BellmanFord)

摘要:http://poj.org/problem?id=3615题意:找一条路径,使得这条路径上最大的两节点权值在所有可能路径中最短,并求出这个值实际上就是Floyd算法,只不过这里不是求的最短路径长度,而是路径上两相邻节点之间的最大距离Cow HurdlesTime Limit:1000MSMemory Limit:65536KDescriptionFarmer John wants the cows to prepare for the county jumping competition, so Bessie and the gang are practicing jumping over 阅读全文

posted @ 2011-01-23 23:54 yming0221 阅读(180) 评论(0) 推荐(0)

摘要:当初把Floyd算法的最外层循环写到最里层了,囧~~~~#include<stdio.h> #define MAX 1000000 int opt[102][102]; int vertexnum; void Floyd() { int _i,_j,_k; for(_j=1;_j<=vertexnum;_j++) for(_k=1;_k<=vertexnum;_k++) for(_i=1;_i<=vertexnum;_i++) { if(opt[_i][_k]+opt[_k][_j]... 阅读全文

posted @ 2010-12-09 22:06 yming0221 阅读(94) 评论(0) 推荐(0)

摘要:ArbitrageTime Limit:1000MSMemory Limit:65536KTotal Submissions:6340Accepted:2831DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys 0.5 British pound, 阅读全文

posted @ 2010-12-07 14:05 yming0221 阅读(123) 评论(0) 推荐(0)

摘要:Til the Cows Come HomeTime Limit:1000MSMemory Limit:65536KTotal Submissions:13050Accepted:4261DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to 阅读全文

posted @ 2010-12-06 22:27 yming0221 阅读(136) 评论(0) 推荐(0)

导航