#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
popa.cpp: In function 'int solve(int, int, int*, int*)':
popa.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
376 KB |
Output is correct |
2 |
Correct |
15 ms |
376 KB |
Output is correct |
3 |
Correct |
14 ms |
396 KB |
Output is correct |
4 |
Correct |
9 ms |
316 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
121 ms |
3036 KB |
Output is correct |
2 |
Correct |
144 ms |
3128 KB |
Output is correct |
3 |
Correct |
153 ms |
3024 KB |
Output is correct |
4 |
Correct |
245 ms |
3132 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
22 ms |
376 KB |
too many querie |
2 |
Halted |
0 ms |
0 KB |
- |