Range queries

Problems on range queries, including the sum, minimum, XOR or count over a segment of an array, queries with updates, and answering many such queries faster than a loop over each segment.

The prefix sums article in the Basics section covers the static case. Related problem sets are under Segment tree, Fenwick tree and Sparse table.

Problems