摘要:
You are a given a list of integers a 1 ,a 2 ,…,a n a1,a2,…,an and s s of its segments [l j ;r j ] [lj;rj] (where 1≤l j ≤r j ≤n 1≤lj≤rj≤n ). You need t 阅读全文
摘要:
Vasya has a tree consisting of n n vertices with root in vertex 1 1 . At first all vertices has 0 0 written on it. Let d(i,j) d(i,j) be the distance b 阅读全文