##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
You've learned tree structures. Sqrt decomposition divides arrays into blocks for O(√n) queries.
The quintessential Mo's algorithm problem. Teaches fundamental add/remove operations and proper block size selection to avoid TLE.
Which block contains i?
Brilliant combination of prefix XOR with Mo's algorithm. Demonstrates how to transform range queries into Mo's algorithm format.
Classic Mo's algorithm counting elements x that occur exactly x times. Great for beginners learning Mo's algorithm basics.
Mo's algorithm on trees using Euler tour transformation. Teaches how to flatten trees into arrays for Mo's algorithm.
Pure sqrt decomposition without Mo's algorithm. Excellent for understanding block-based updates and jump operations.
Advanced sqrt decomposition with cyclic shifts. Demonstrates lazy propagation concepts and block maintenance with deques.
Sqrt optimization on trees with BFS preprocessing every √m queries. Teaches query batching techniques for maintaining O(q√n) complexity.
Introduces heavy-light decomposition for sets. Splits sets into 'heavy' and 'light' demonstrating threshold-based sqrt decomposition.
Sqrt decomposition with lazy propagation for Fibonacci updates. Combines mathematical properties with block-based updates.
Range update and range query with sqrt decomposition. Teaches lazy propagation on blocks tracking colorfulness changes.
Graph-based sqrt decomposition splitting nodes by degree. Demonstrates applying sqrt decomposition beyond arrays.
Sqrt decomposition for connectivity queries across colored edges. Teaches handling multiple dimensions with sqrt techniques.
Foundational sqrt decomposition problem. Perfect introduction teaching how to split arrays into √n blocks with precomputed sums.
Solvable with sqrt decomposition maintaining block-level majority candidates. Demonstrates advanced aggregation beyond simple sums.
Sqrt decomposition for 2D range queries. Shows how to extend 1D block decomposition to 2D problems efficiently.
Range flip operations with sqrt decomposition and lazy updates. Teaches handling bit flips in blocks with pending XOR operations.
Interval system solvable with sqrt decomposition. Shows maintaining interval coverage using blocks instead of trees.
Dynamic interval merging with sqrt decomposition. Demonstrates maintaining distinct counts across overlapping intervals.
Coordinate compression with sqrt decomposition for interval maximum queries. Handles large coordinate spaces with manageable blocks.
Interval painting with overlap detection. Combines range updates with jump pointers demonstrating path compression in blocks.