用线段树吧
by yynn @ 2021-09-06 13:25:04
@[Jerry6B](/user/477368)
by yynn @ 2021-09-06 13:25:17
线段树多好,你说是吧
by yynn @ 2021-09-06 13:31:40
```cpp
for(reint i=1,x;i<=m;i++){
x=read();
add(i,x);
}
```
把里面的 $m$ 改成 $n$ 。
by CE_WA_TLE @ 2021-09-06 13:36:29