POJ 3259. Wormholes
1. 题目 http://poj.org/problem?id=3259 Wormholes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 36967 Accepted: 13562 Description While exploring his many farms, Farmer John has discovered a…
Read more
learn, build, evaluate
1. 题目 http://poj.org/problem?id=3259 Wormholes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 36967 Accepted: 13562 Description While exploring his many farms, Farmer John has discovered a…
Read more
Bellman-Ford算法用于计算有向图中的单源最短路径。对于有V个顶点和E条边的图,Bellman-Ford的时间复杂度为O(V·E),效率低于Dijkstra算法。Bellman-Ford可以用于有负权边的情况,且能判断负权环,十分灵活。 Wiki上给出的Bellman-Ford算法的伪代码如下所示: function BellmanFord(list vertices, list …
Read more
1. 题目 http://acm.timus.ru/problem.aspx?space=1&num=1162 1162. Currency Exchange Time limit: 1.0 second Memory limit: 64 MB Several currency exchange points are working in our city. Let us suppose …
Read more