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

建议使用的浏览器:

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

7175:Link with Running

题目描述
Link hates running.

Today, Link is asked to run. Roads in BIT can be described as $n$ nodes and $m$ directed edges. Link has to run from node $1$ to node $n$. When Link is at node $u_i$, he can run through the $i$-th edge to get to node $v_i$. Every time he runs through the $i$-th edge, he spends $e_i$ points of energy and gains $p_i$ points of physical fitness.

As a lazy boy, Link wants to spend as little energy as possible. He is also greedy and wants to gain maximum physical fitness when spending minimum energy.

Tell Link the minimum energy $min_e$ he needs to spend and the maximum physical fitness $max_p$ he can gain when spending the minimum energy.
输入解释
Each test contains multiple test cases. The first line contains the number of test cases $T(1 \le T \le 12)$. Description of the test cases follows.

The first line contains two integers $n,m(2 \leq n \leq 10^5, 1 \leq m \leq 3 \times 10^5)$, which are the number of nodes and the number of edges.

Each of the next $m$ lines contains four integers $u_i,v_i,e_i,p_i(1 \leq u_i,v_i \leq n, 0 \leq e_i,p_i \leq 10^9$), describing an edge.
输出解释
For each test case, output $min_e$ and $max_p$ in a single line, separated by one space.

It is guaranteed that THE ANSWER EXISTS and CAN BE REPRESENTED AS A NUMBER.
输入样例
2
3 3
1 2 1 1
2 3 1 1
1 3 2 0
3 3
1 2 1 1
2 3 1 1
1 3 1 0
输出样例
2 2
1 0

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

源链接: HDU-7175

最后修改于 2022-09-15T06:17:10+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
16000/8000MS(Java/Others) 262144/262144K(Java/Others)