CSES
-
Static Range Minimum QueriesCSES 2023. 12. 7. 16:08
방법 1 - Segment tree Build a Range minimum query segment tree in O(N) time and answer each query in O(logN). 방법 2 - Sparse Table Sparse Table - Algorithms for Competitive Programming Sparse Table Sparse Table is a data structure, that allows answering range queries. It can answer most range queries in $O(\log n)$, but its true power is answering range minimum queries (or equivalent range maximum ..