当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6705:path

题目描述
You have a directed weighted graph with $n$ vertexes and $m$ edges. The value of a path is the sum of the weight of the edges you passed. Note that you can pass any edge any times and every time you pass it you will gain the weight.

Now there are $q$ queries that you need to answer. Each of the queries is about the k-th minimum value of all the paths.
输入解释
The input consists of multiple test cases, starting with an integer $t$ $(1\leq t\leq 100)$, denoting the number of the test cases.
The first line of each test case contains three positive integers n,m,q. $(1\leq n,m,q\leq 5*10^4)$

Each of the next $m$ lines contains three integers $u_i,v_i,w_i$, indicating that the $i-th$ edge is from $u_i$ to $v_i$ and weighted $w_i$.$(1\leq u_i,v_i \leq n,1\leq w_i\leq 10^9)$

Each of the next $q$ lines contains one integer $k$ as mentioned above.$(1\leq k\leq 5*10^4)$

It's guaranteed that $\Sigma n$ ,$\Sigma m$, $\Sigma q , \Sigma \max(k)\leq 2.5*10^5$ and $\max(k)$ won't exceed the number of paths in the graph.
输出解释
For each query, print one integer indicates the answer in line.
输入样例
1
2 2 2
1 2 1
2 1 2
3
4
输出样例
3
3
提示
1->2 value :1

2->1 value: 2

1-> 2-> 1 value: 3

2-> 1-> 2 value: 3

来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6705

最后修改于 2020-10-25T23:33:39+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/2000MS(Java/Others) 65536/65536K(Java/Others)