本题有分块做法,复杂度 O(qn∣Σ∣)O(q\sqrt n|\Sigma|)O(qn∣Σ∣) ,已成功通过。但题解区还没有。 而且非常快,不开O2总用时进1秒。 https://www.luogu.com.cn/record/112116604