Bellman-Ford算法简介
Bellman-Ford算法用于计算有向图中的单源最短路径。对于有V个顶点和E条边的图,Bellman-Ford的时间复杂度为O(V·E),效率低于Dijkstra算法。Bellman-Ford可以用于有负权边的情况,且能判断负权环,十分灵活。 Wiki上给出的Bellman-Ford算法的伪代码如下所示: function BellmanFord(list vertices, list …
Read more
learn, build, evaluate
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=1008 1008. Image Encoding Time limit: 2.0 second Memory limit: 64 MB There are several ways to encode an image. In this problem we will consider …
Read more
1. 题目 http://acm.timus.ru/problem.aspx?space=1&num=1072 1072. Routing Time limit: 1.0 second Memory limit: 64 MB There is a TCP/IP net of several computers. It means that: Each computer has one or…
Read more
1. 题目 http://poj.org/problem?id=3414 Pots Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 12107 Accepted: 5110 Special Judge Description You are given two pots, having the volume of A and B…
Read more
1. 题目 http://acm.timus.ru/problem.aspx?space=1&num=1080 1080. Map Coloring Time limit: 1.0 second Memory limit: 64 MB We consider a geographical map with N countries numbered from 1 to N (0 < N…
Read more
1. 题目 http://acm.timus.ru/problem.aspx?space=1&num=1033 1033. Labyrinth Time limit: 1.0 second Memory limit: 64 MB Administration of the labyrinth has decided to start a new season with new wallpa…
Read more
1. 题目 http://acm.timus.ru/problem.aspx?space=1&num=1837 1837. Isenbaev’s Number Time limit: 0.5 second Memory limit: 64 MB Vladislav Isenbaev is a two-time champion of Ural, vice champion o…
Read more
1. 题目 http://acm.timus.ru/problem.aspx?space=1&num=1643 1263. Elections Time limit: 1.0 second Memory limit: 64 MB The next in turn elections are to come soon. All the fences are postered with lea…
Read more
1. 题目 http://acm.timus.ru/problem.aspx?space=1&num=1208 1208. Legendary Teams Contest Time limit: 1.0 second Memory limit: 64 MB Nothing makes as old as years. A lot of cool contests are gone, a l…
Read more
1. 题目 http://acm.timus.ru/problem.aspx?space=1&num=1643 1643. Attack of the Dark Fortress Time limit: 1.0 second Memory limit: 64 MB Knowing that lich Sandro left to fight the King of Hell, Erathi…
Read more