随笔分类 -  最短路

上一页 1 2

POJ 3255 Wormholes(最短路最负环)
摘要:WormholesTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 20639Accepted: 7342DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that is BE 阅读全文

posted @ 2012-08-18 00:05 kuangbin 阅读(776) 评论(0) 推荐(0)

POJ 1860 Currency Exchange(BellmanFord算法的变形,求正环)
摘要:/*POJ 1860有多种汇币,汇币之间可以交换,这需要手续费,当你用100A币交换B币时,A到B的汇率是29.75,手续费是0.39,那么你可以得到(100 - 0.39) * 29.75 = 2963.3975 B币。问s币的金额经过交换最终得到的s币金额数能否增加货币的交换是可以重复多次的,所以我们需要找出是否存在正权回路,且最后得到的s金额是增加的怎么找正权回路呢?(正权回路:在这一回路上,顶点的权值能不断增加即能一直进行松弛)关键在于反向利用Bellman-Ford算法单源最短路径算法,因为题目可能存在负边,所以用Bellman Ford算法,原始Bellman Ford可以用来求负 阅读全文

posted @ 2012-08-17 23:06 kuangbin 阅读(3512) 评论(0) 推荐(1)

POJ 3159 Candies(差分规划+SPFA)
摘要:CandiesTime Limit: 1500MSMemory Limit: 131072KTotal Submissions: 18737Accepted: 4930DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the kids 阅读全文

posted @ 2012-08-17 21:31 kuangbin 阅读(3901) 评论(0) 推荐(1)

POJ 3169 Layout(差分约束+SPFA)
摘要:LayoutTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 4641Accepted: 2240DescriptionLike everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a straight line waiting for feed. The cows are standing 阅读全文

posted @ 2012-08-17 20:38 kuangbin 阅读(2551) 评论(0) 推荐(0)

HDU 4370 0 or 1(最短路)
摘要:0 or 1Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 692Accepted Submission(s): 185Problem DescriptionGiven a n*n matrix Cij (1<=i,j<=n),We want to find a n*n matrix Xij (1<=i,j<=n),which is 0 or 1.Besides,Xij meets the following condi 阅读全文

posted @ 2012-08-17 19:20 kuangbin 阅读(3073) 评论(0) 推荐(1)

上一页 1 2

导航

JAVASCRIPT: