http://acm.hdu.edu.cn/showproblem.php?pid=1596 分析: 题目要找一条安全度最高的路,安全度计算方法 Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 在Dijkstra算法的基础上稍加改动 ...
分类:
其他好文 时间:
2017-03-23 23:21:41
阅读次数:
263
Byteotia城市有n个 towns m条双向roads. 每条 road 连接 两个不同的 towns ,没有重复的road. 你要把其中一些road变成单向边使得:每个town都有且只有一个入度 和上题一样... ...
分类:
其他好文 时间:
2017-03-21 12:26:57
阅读次数:
138
题意: 给出一个有向图,求每条边有多少次作为最短路上的边(任意的起始点)。 范围:n <= 1500, m <= 5005 分析: 一个比较容易想到的思路:以每个点作为起点,做一次SPFA,记f[i]表示从点S到达点i的最短路数,g[i]表示从点i到达点T的最短路数。 那么对于任意一条边,答案就是∑ ...
分类:
其他好文 时间:
2017-03-21 10:09:34
阅读次数:
171
Description C国有n座城市,城市之间通过m条单向道路连接。一条路径被称为最短路,当且仅当不存在从它的起点到终点的另外一条路径总长度比它小。两条最短路不同,当且仅当它们包含的道路序列不同。我们需要对每条道路的重要性进行评估,评估方式为计算有多少条不同的最短路经过该道路。现在,这个任务交给了 ...
分类:
其他好文 时间:
2017-03-14 00:11:29
阅读次数:
239
Bill and Ted are taking a road trip. But the odometer in their car is broken, so they don't know how many miles they have driven. Fortunately, Bill ha ...
分类:
其他好文 时间:
2017-03-10 21:06:44
阅读次数:
158
题意: The main road in Bytecity is a straight line from south to north. Conveniently, there are coordinates measured in meters from the southernmost bui ...
分类:
其他好文 时间:
2017-03-07 20:43:26
阅读次数:
189
题意: 对于边带权的无向图 G = (V, E),请选择一些边, 使得1<=i<=d,i号节点和 n ? i + 1 号节点可以通过选中的边连通, 最小化选中的所有边的权值和。 d<=4 n<=10000 m<=10000 w[i]<=1000 思路: 求一个最小生成树(或森林),使得若干组点对各自 ...
分类:
其他好文 时间:
2017-03-07 16:50:01
阅读次数:
390
B. The Meeting Place Cannot Be Changed B. The Meeting Place Cannot Be Changed The main road in Bytecity is a straight line from south to north. Conven ...
分类:
其他好文 时间:
2017-03-07 08:10:12
阅读次数:
206
using UnityEngine; using System; namespace RoadCrossing.Types { /// <summary> /// 小路 /// </summary> [Serializable] public class Lane { /// <summary> / ...
分类:
其他好文 时间:
2017-02-25 19:57:18
阅读次数:
257
Great minds have purpose, others only have wishes. 杰出的人有着目标,其他人只拥有愿望。 All you need is the plan, the road map, and the courage to press on to your dest ...
分类:
其他好文 时间:
2017-02-23 00:58:50
阅读次数:
193