最短路
wJs9528-1
这个作者很懒,什么都没留下…
展开
-
POJ 1556 The Doors 计算几何+MST
DescriptionYou are to find the length of the shortest path through a chamber containing obstructing walls. The chamber will always have sides at x = 0, x = 10, y = 0, and y = 10. The initial and f原创 2015-08-09 16:47:23 · 394 阅读 · 0 评论 -
ZOJ 3946 Highway Project(spfa最短路+记忆化搜索)
Highway ProjectTime Limit: 2 Seconds Memory Limit: 65536 KB Edward, the emperor of the Marjar Empire, wants to build some bidirectional highways so that he can reach other cities from t原创 2016-04-23 23:59:32 · 663 阅读 · 0 评论 -
HDU 5723 Abandoned country
题意:给出一张图,求最小生成树和树上两点距离的期望分析:注意到每条边的权值都不一样,那么最小生成树一定唯一,解决了第一个问题,对于第二个问题,只需要计算每条边的计算次数,那么dfs子树节点个数 s乘以(n-s)即是计算边次数,再除以n*(n-1)/2即是答案#include#include#include#includeusing namespace std;#def原创 2016-07-19 21:02:02 · 812 阅读 · 0 评论