HDU3078 Network [2016年6月计划 树上问题05]
2021-07-14 02:07
标签:style return etc pac udt hot case other ignore Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) HDU3078 Network [2016年6月计划 树上问题05] 标签:style return etc pac udt hot case other ignore 原文地址:http://www.cnblogs.com/huibixiaoxing/p/7076740.htmlNetwork
Total Submission(s): 1293 Accepted Submission(s): 575
The usual way to measure connecting
speed is lag, or network latency, referring the time taken for a sent
packet of data to be received at the other end.
Now the network is on
trial, and new photonic crystal fibers designed by ALPC42 is trying
out, the lag on fibers can be ignored. That means, lag happened when
message transport through the router. ALPC42 is trying to change routers
to make the network faster, now he want to know that, which router, in
any exactly time, between any pair of nodes, the K-th high latency is.
He needs your help.
Your
program is able to get the information of N routers and N-1 fiber
connections from input, and Q questions for two condition: 1. For some
reason, the latency of one router changed. 2. Querying the K-th longest
lag router between two routers.
For each data case, two integers N and Q for first line. 0Then n integers in second line refer to the latency of each router in the very beginning.
Then N-1 lines followed, contains two integers x and y for each, telling there is a fiber connect router x and router y.
Then
q lines followed to describe questions, three numbers k, a, b for each
line. If k=0, Telling the latency of router a, Ta changed to b; if
k>0, asking the latency of the k-th longest lag router between a and b
(include router a and b). 0A blank line follows after each case.#include
下一篇:hibernate知识
文章标题:HDU3078 Network [2016年6月计划 树上问题05]
文章链接:http://soscw.com/essay/104899.html