Expand description
A collection of example ArqSpec implementations
Enums§
- Assign
Min - Range Minimum Query (RMQ), a classic application of ARQ. update(l, r, &f) sets all entries a[l..=r] to f. query(l, r) finds the minimum value in a[l..=r].
- Assign
Sum - Range Sum Query, a slightly trickier classic application of ARQ. update(l, r, &f) sets all entries a[l..=r] to f. query(l, r) sums all the entries a[l..=r].
- Supply
Demand - Supply & Demand, based on https://codeforces.com/gym/102218/problem/F update(i, i, &(p, o)) increases supply by p and demand by o at time i. query(l, r) computes total supply and demand at times l to r, as well as