RT,树状数组板子题,可以通过P3374的代码直接通过,具体可见:
https://www.luogu.com.cn/record/42923623
https://www.luogu.com.cn/record/42866119