Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Contest Scan โ€” Reading for Structure

โญโญโญ advancedโณ 25 min read๐Ÿ“ Lesson 189 of 281

Advanced problems hide their structure behind stories. The first read extracts constraints, operation mix, and the family each problem belongs to.

Scan before you solve

For each problem, extract three things in the first read: the largest n and q, the OPERATION MIX (updates vs queries, ordered vs arbitrary), and what quantity is asked (value? count? existence?). That triple usually pins the algorithm family before you understand the story.

Range question + updates on segments = lazy tree family. Reachability questions = SCC/DSU/union family. "Best swap after building X" = exchange argument on top of the standard construction. Say the family out loud, then verify with the constraints: n = 2e5 with per-op O(n) is dead; O(n log n) or O(n alpha) is alive.