update
This commit is contained in:
parent
ba9d9526fd
commit
0464e800da
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user