摘要:
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 阅读全文