update
This commit is contained in:
parent
ba9d9526fd
commit
0464e800da
@ -51,10 +51,10 @@ signed main(){
|
|||||||
});
|
});
|
||||||
Tree cmax(n);
|
Tree cmax(n);
|
||||||
for(int i=1;i<=n;i++){
|
for(int i=1;i<=n;i++){
|
||||||
cmax.update(cow[i].dir, 1);
|
int l=cmax.query1to(cow[i].dir);
|
||||||
int l=cmax.query1to(cow[i].dir-1);
|
|
||||||
int r = i-l-1;
|
int r = i-l-1;
|
||||||
if(max(l,r)>min(l,r)*2)ans++;
|
if(max(l,r)>min(l,r)*2)ans++;
|
||||||
|
cmax.update(cow[i].dir, 1);
|
||||||
}
|
}
|
||||||
cout<<ans<<endl;
|
cout<<ans<<endl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user