Read each operation contract before selecting an answer. Bounds, duplicate readings, discarded constraints, and pending reversals change the result.
Lessons
- Sparse coordinate segment tree: allocate only visited paths
- Wavelet tree: subarray counts and order statistics
- Parity disjoint set: maintain same-or-different constraints
- Implicit treap: edit positions and reverse a range
