@[_YuTian_](/user/655082) 你 `while(n--)` 会让 n 变小,但是线段树右端点还是 n。 加了个 `int fn=n;` 然后 `while(fn--)` 实测过了。 by 冰糖鸽子 @ 2023-12-14 16:04:59