这篇题解声称是 2log 的,但事实上它有 O(nlogn)\mathcal{O}(n\log n)O(nlogn) 次操作,每一次操作都是在树套树上 2log 查询,因此是 3log 的。
同时求教本题 2log SA 做法。