Sparse table
- Stage
- 7
- Module
- M7.3
- Lessons
- 1
In this module
- Precompute O(N log N) sparse table for O(1) idempotent range queries.
- Implement sparse table using logarithmic doubling.
- Optimize queries for min, max, and gcd.
Before this module
Lessons
Practice
Try this on the judge. The link opens the problem on WMOJ.
- 2021 S5Math Homework (opens on WMOJ in a new tab) WMOJ
Verify that every consecutive range has the same GCD.