220b专题

Codeforces 220B - Little Elephant and Array 离线树状数组

This problem can be solve in simpler O(NsqrtN) solution, but I will describe O(NlogN) one. We will solve this problem in offline. For each x (0 ≤ x < n) we should keep all the queries that

CodeForces 220B : Little Elephant and Array 莫队

传送门 题意 小象喜欢和数组玩。现在有一个数组 a a a,含有 n n n个正整数,记第 i i i个数为 a i a_i ai​ 现在有 m m m个询问,每个询问包含两个正整数 l j l_j lj​和 r j ( 1 < = l j < = r j < = n ) r_j(1<=l_j<=r_j<=n) rj​(1<=lj​<=rj​<=n),小象想知道在 l l l到 r r r之