Sharing666 @ 2022-05-17 13:38:07
Root[1]=build(1,n);
为什么 Root 下标要从 1 开始
by S0CRiA @ 2022-05-17 13:47:14
从0开始也可以吧
by gyyyyx @ 2022-05-17 18:38:12
个人习惯?
by Sharing666 @ 2022-05-19 13:36:13
@_zyINF 不行,会 WA
by Sharing666 @ 2022-05-19 13:36:49
@不秒倒的咒术 但是改成 0 过不了
by S0CRiA @ 2022-05-19 13:52:49
@Sharing666 那肯定是别的什么地方也要改一下
by Sharing666 @ 2022-05-19 14:14:51
@_zyINF
bool Check(int x,int A,int B,int C,int D) {
int sum=Query(rt[x-1],1,n,B+1,C-1).sum;
int lma=Query(rt[x-1],1,n,A,B).rma;
int rma=Query(rt[x-1],1,n,C,D).lma;
if(lma+sum+rma>=0) return 1;
return 0;
}
可以从 0 开始,但是要把