This commit is contained in:
Zengtudor 2024-08-13 11:35:25 +08:00
parent ba9d9526fd
commit 0464e800da

View File

@ -51,10 +51,10 @@ signed main(){
});
Tree cmax(n);
for(int i=1;i<=n;i++){
cmax.update(cow[i].dir, 1);
int l=cmax.query1to(cow[i].dir-1);
int l=cmax.query1to(cow[i].dir);
int r = i-l-1;
if(max(l,r)>min(l,r)*2)ans++;
cmax.update(cow[i].dir, 1);
}
cout<<ans<<endl;
}