# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
92885 |
2019-01-05T12:18:33 Z |
Pajaraja |
popa (BOI18_popa) |
C++17 |
|
130 ms |
2168 KB |
#include <bits/stdc++.h>
#include "popa.h"
#define MAXN 1007
using namespace std;
int ls[MAXN],rs[MAXN];
int rek(int lt,int rt)
{
if(lt>rt) return -1;
int l=lt,r=rt;
while(l!=r)
{
int s=(l+r)/2;
if(query(lt,rt,lt,s)) r=s;
else l=s+1;
}
ls[l]=rek(lt,l-1);
rs[l]=rek(rt,l+1);
return l;
}
int solve(int N,int* Left,int* Right)
{
int a=rek(0,N-1);
for(int i=0;i<N;i++) Left[i]=ls[i];
for(int i=0;i<N;i++) Right[i]=rs[i];
return a;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
296 KB |
not a valid binary tree |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
130 ms |
2168 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
22 ms |
460 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |