# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
92886 |
2019-01-05T12:20:30 Z |
Pajaraja |
popa (BOI18_popa) |
C++17 |
|
255 ms |
504 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(l+1,rt);
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 |
Correct |
18 ms |
420 KB |
Output is correct |
2 |
Correct |
25 ms |
248 KB |
Output is correct |
3 |
Correct |
4 ms |
320 KB |
Output is correct |
4 |
Correct |
16 ms |
408 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
241 ms |
376 KB |
Output is correct |
2 |
Correct |
255 ms |
504 KB |
Output is correct |
3 |
Correct |
111 ms |
372 KB |
Output is correct |
4 |
Correct |
185 ms |
444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
45 ms |
336 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |