摘要:
Two students are playing the following game. There are 2· n points on the plane, given with their coordinates ( xi, yi). Each move player paints the p 阅读全文
摘要:
You are given two integers l l and r r (l≤r l≤r ). Your task is to calculate the sum of numbers from l l to r r (including l l and r r ) such that eac 阅读全文
摘要:
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 阅读全文