我是用结构体+可持久化线段树解的
开始时是这样写的
const int N=2e7+10;
int ans[1<<20],edit[1<<20]={1};
struct tree{
int sum,ls,rs;
}t[N];
然后就快乐的RE了(欲哭无泪)
想了好久,结果是,改成这样...
const int N=1e6+10;
int ans[N*25],edit[N]={1};;
struct tree{
int sum[N*25],ls[N*25],rs[N*25];
}t;
说实话好多题解都过不去第二个点的啊