Sqrt decomposition
- Stage
- 7
- Module
- M7.9
- Lessons
- 1
In this module
- Partition a large problem into heavy and light groups.
- Process heavy items as special cases and light items with standard algorithms.
- Use square-root blocking to balance preprocessing and query time.
- Recognize when Python performance limits apply and accept partial-mark subtasks.
Before this module
Lessons
Practice
Try this on the judge. The link opens the problem on DMOJ.
- 2017 S5RMT (opens on DMOJ in a new tab) DMOJ
Many queries over a transit network's routes.
Why DMOJ: An older problem with a large number of queries, good for practicing where a partial, unoptimized attempt still scores.