--- slug: /plat/1DRQ title: "Platinum - 1D Range Queries" author: Benjamin Qi --- # Platinum - 1D Range Queries Author: Benjamin Qi ## Static Range Queries ### Range Minimum Query * Tutorial * [Wikipedia](https://en.wikipedia.org/wiki/Range_minimum_query) * (add) ### General Static Range Queries * Static range queries in $O(1)$ time and $O(N\log N)$ preprocessing for any associative operation? * (add) ## Segment Tree Author: Benjamin Qi This data structure allows you to do point update and range query in $O(\log N)$ time each for any associative operation. * Tutorial * CPH 9.3 * [CSAcademy Tutorial](https://csacademy.com/lesson/segment_trees/) * [cp-algorithms](https://cp-algorithms.com/data_structures/segment_tree.html) * [Codeforces Tutorial](http://codeforces.com/blog/entry/18051) * [Slides from CPC.3](https://github.com/SuprDewd/T-414-AFLV/tree/master/03_data_structures) ### Practice Problems * [USACO Springboards](http://www.usaco.org/index.php?page=viewproblem2&cpid=995) * can use segment tree with min query in place of the map mentioned in analysis * [POI Cards](https://szkopul.edu.pl/problemset/problem/qpsk3ygf8MU7D_1Es0oc_xd8/site/?key=statement) [](81) * [Counting Haybales (USACO Plat)](http://www.usaco.org/index.php?page=viewproblem2&cpid=578) * Lazy Updates