이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |