最短路
admin__
这个作者很懒,什么都没留下…
展开
-
最短路径问题
题目: 给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。 Input 输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。 (1<n<=1000, 0&...原创 2018-08-14 14:59:53 · 215 阅读 · 0 评论 -
六度分离
题目: 1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six degrees of separation)。虽然米尔格兰姆的理论屡屡应验,一直也有很多社会学家对其兴趣浓厚,但是在30...原创 2018-08-14 15:10:03 · 138 阅读 · 0 评论 -
Subway
题目: You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don't ...原创 2018-08-14 15:59:22 · 233 阅读 · 0 评论 -
Minimum Transport Cost
题目: These are N cities in Spring country. Between each pair of cities there may be one transportation track or none. Now there is some cargo that should be delivered from one city to another. The tra...原创 2018-08-16 20:34:06 · 101 阅读 · 0 评论 -
Slim Span
题目: Given an undirected weighted graph G, you should find one of spanning trees specified as follows. The graph G is an ordered pair (V, E), where V is a set of vertices {v1, v2, …, vn} and E is a s...原创 2018-08-16 20:50:35 · 126 阅读 · 0 评论 -
Mr. Kitayuta's Colorful Graph
题目: Mr. Kitayuta has just bought an undirected graph consisting of n vertices and m edges. The vertices of the graph are numbered from 1 to n. Each edge, namely edge i, has a color ci, connecting ver...原创 2018-08-19 21:32:31 · 145 阅读 · 0 评论 -
Roadblocks ———POJ - 3255 (次短路)
题目: Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery along the way...原创 2019-04-28 08:49:37 · 115 阅读 · 0 评论