This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
int query(int a,int b,int c,int d);
int rezolva(int b,int e,int* Left,int* Right)
{
if(b>e)
return -1;
if(b==e)
{
Left[b]=Right[b]=-1;
return b;
}
int cb=b,ce=e;
while(b<=e)
{
int mid=(b+e)/2;
if(query(cb,mid,cb,ce)==1)
e=mid-1;
else
b=mid+1;
}
Left[b]=rezolva(cb,b-1,Left,Right);
Right[b]=rezolva(b+1,ce,Left,Right);
return b;
}
int solve(int N, int* Left, int* Right)
{
return rezolva(0,N-1,Left,Right);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |