rt,用的是官方题解的做法,时间复杂度为 O(QlogN(∣S∣+logN)+N∣S∣logN)\mathcal{O}(Q\log N(|S|+\log N)+N|S|\log N)O(QlogN(∣S∣+logN)+N∣S∣logN)。
TLE on 9 代码