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>
#include<popa.h>
using namespace std;
/*
int query(int a,int b,int c,int d)
{
}
*/
int solve(int l,int r,int* Left,int* Right)
{
if(l==r)
{
Left[l]=-1;
Right[l]=-1;
return l;
}
if(l>r)return -1;
vector<int> order={};
for(int i=0;l+i<=r-i;i++)
{
order.push_back(l+i);
order.push_back(r-i);
}
for(auto i:order)
if(query(l,r,i,i))
{
Left[i]=solve(l,i-1,Left,Right);
Right[i]=solve(i+1,r,Left,Right);
return i;
}
}
int solve(int N, int* Left, int* Right)
{
return solve(0,N-1,Left,Right);
}
Compilation message (stderr)
popa.cpp: In function 'int solve(int, int, int*, int*)':
popa.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |