摘要:
A rooted tree is a well known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with 阅读全文
摘要:
Mike and !Mike are old childhood rivals, they are opposite in everything they do, except programming. Today they have a problem they cannot solve on t 阅读全文
摘要:
Tom owns a company and he is the boss. There are n staffs which are numbered from 1 to n in this company, and every staff has a ability. Now, Tom is g 阅读全文
摘要:
In Land waterless, water is a very limited resource. People always fight for the biggest source of water. Given a sequence of water sources with a1,a2 阅读全文
摘要:
Write a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ances 阅读全文
摘要:
1.ST表+时间戳 DFS记录这棵树每个点出现的时间1 2 3 2 4 2 5 2 1 6 7 8 7 6 1。 然后用ST表记录每个区间的min值,然后进行q次查询,时间复杂度O(Nlog2N+Qlog2N); include include include include include inc 阅读全文
摘要:
"来源poj2263" Big Johnsson Trucks Inc. is a company specialized in manufacturing big trucks. Their latest model, the Godzilla V12, is so big that the am 阅读全文