# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
61994 |
2018-07-27T08:20:19 Z |
노영훈(#1796) |
popa (BOI18_popa) |
C++11 |
|
24 ms |
444 KB |
#include "popa.h"
#include <iostream>
using namespace std;
static const int MX=1010;
int my_q(int x, int l, int r){
return query(x,x,l,r);
}
static int n;
static int *Lson, *Rson;
static int tree[2*MX];
static int init(int v, int s, int e){
if(s==e) return s;
int m=(s+e)/2;
int l=init(v*2, s, m), r=init(v*2+1, m+1, e);
if(my_q(l,s,e)){
tree[v]=l;
Rson[m]=r;
}
else{
tree[v]=r;
Lson[m+1]=l;
}
// cout<<s<<' '<<e<<": "<<tree[v]<<'\n';
return tree[v];
}
int solve(int N, int _Lson[], int _Rson[]){
n=N; Lson=_Lson, Rson=_Rson;
for(int i=0; i<n; i++) Lson[i]=Rson[i]=-1;
int root=init(1,0,n-1);
// for(int i=0; i<n; i++) cout<<Lson[i]<<' ';
// cout<<'\n';
// for(int i=0; i<n; i++) cout<<Rson[i]<<' ';
// cout<<'\n';
return root;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
376 KB |
not a valid solution |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
17 ms |
388 KB |
not a valid solution |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
24 ms |
444 KB |
not a valid solution |
2 |
Halted |
0 ms |
0 KB |
- |