Segment Tree
Answer range queries and point updates in O(log n) by storing the answer for every halved segment of the array.
The problem
You have an array of n numbers and q operations. Each one is either "set a[i] to v" or "print the sum of a[l..r]". Both n and q can reach 200,000.
1 of 10