摘要: 题意:求两块石头之间的青蛙的距离,即:起点到终点所有路径中最大跳跃距离的最小值思路:可以用floyd来求解floyd变形为dis[i][j]=MIN(dis[i][j],MAX(dis[i][k],dis[k][j]));View Code 1 // I'm the Topcoder 2 //C 3 #include <stdio.h> 4 #include <stdlib.h> 5 #include <string.h> 6 #include <ctype.h> 7 #include <math.h> 8 #include 阅读全文
posted @ 2013-03-24 23:49 南下的小程序员 阅读(200) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2263题意:汽车的载重量没有限制,取决于道路的承载能力,求起点到终点所经过的路径不会超过道路的承载限制。分析:本题并不是求最短路径,而是求通过的能力最大的路,这种路可以称作最大容量路,可以用floyd算法的思想求解。设城市i到城市j的承载能力记为【i,j】,初始时K到M没有直接路径,因此k到M的承载重量为0。即【K,M】=0.加入中间结点H后,K到M的承载重量改为MAX{【K,M】,MIN([K,H],[H,K])};View Code 1 // I'm the Topcoder 2 //C 3 #include <stdio 阅读全文
posted @ 2013-03-24 22:24 南下的小程序员 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Fiber NetworkTime Limit:1000MSMemory Limit:65536KTotal Submissions:2624Accepted:1203DescriptionSeveral startup companies have decided to build a better Internet, called the "FiberNet". They have already installed many nodes that act as routers all around the world. Unfortunately, they star 阅读全文
posted @ 2013-03-24 21:20 南下的小程序员 阅读(225) 评论(0) 推荐(0) 编辑