# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
721189 | bin9638 | Comparing Plants (IOI20_plants) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
int vt=x;
for(int k=LOG;k>=0;k--)
if(pre[vt][k]!=-1&&!(pre[vt][k]>x&&pre[vt][k]<=y)&&dis(pre[vt][k],y)>k-1)
vt=pre[vt][k];
if(dis(vt,y)>k-1)
vt=pre[vt][0];
if(vt!=-1&&h[vt]>=h[y])
return 1;
vt=x;
for(int k=LOG;k>=0;k--)
if(nxt[vt][k]!=-1&&(nxt[vt][k]>=x&&nxt[vt][k]<=y)&&dis(nxt[vt][k],y)>k-1)
vt=nxt[vt][k];
if(dis(vt,y)>k-1)
vt=nxt[vt][0];
if(vt!=-1&&h[vt]>=h[y])
return 1;