版本比较
RMQ 问题与 ST 表应用
正文
增加 7 行删除 6 行
293 行未改动全部展开294295296297298299300301302303293 行未改动全部展开我只会写倍增和树剖。欧拉序做法可能更好理解点,但是会有 $2$ 倍常数。DFS 序常数就比较小了。参见[冷门科技 —— DFS 序求 LCA](https://www.luogu.com.cn/article/pu52m9ue)。# 实践题目1. 以上所有例题2. [分数统计](https://www.luogu.com.cn/problem/P2442)(数据结构缝合怪)3. [[NOI2016] 优秀的拆分](https://www.luogu.com.cn/problem/P1117)(套 SA 后缀数组)4. [章节划分](https://www.luogu.com.cn/problem/P7244)(分治)5. [[COCI 2022/2023 #1] Neboderi](https://www.luogu.com.cn/problem/P9032)($\gcd$ 结论)6. [[JOI 2026 二次预选] 船 / Ship](https://www.luogu.com.cn/problem/P14800)(贪心)7. [Exposition](https://www.luogu.com.cn/problem/CF6E)(二分)293 行未改动全部展开294295296297298299300301302303304293 行未改动全部展开我只会写倍增和树剖。欧拉序做法可能更好理解点,但是会有 $2$ 倍常数。DFS 序常数就比较小了。参见[冷门科技 —— DFS 序求 LCA](https://www.luogu.com.cn/article/pu52m9ue)。# 实践题目1. 以上所有例题2. [[SCOI2007] 降雨量](https://www.luogu.com.cn/problem/P2471)(分讨)3. [分数统计](https://www.luogu.com.cn/problem/P2442)(数据结构缝合怪)4. [[NOI2016] 优秀的拆分](https://www.luogu.com.cn/problem/P1117)(套 SA 后缀数组)5. [章节划分](https://www.luogu.com.cn/problem/P7244)(分治)6. [[COCI 2022/2023 #1] Neboderi](https://www.luogu.com.cn/problem/P9032)($\gcd$ 结论)7. [[JOI 2026 二次预选] 船 / Ship](https://www.luogu.com.cn/problem/P14800)(贪心)8. [Exposition](https://www.luogu.com.cn/problem/CF6E)(二分)