# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
64472 |
2018-08-04T15:38:40 Z |
TadijaSebez |
popa (BOI18_popa) |
C++11 |
|
104 ms |
664 KB |
#include "popa.h"
#include <stdio.h>
const int N=1050;
int S[N],c;
int solve(int n, int* l, int* r)
{
int i;
int root=-1;c=0;
for(i=0;i<n;i++)
{
l[i]=r[i]=-1;
while(c && query(S[c],i,i,i))
{
r[S[c]]=l[i];
l[i]=S[c];
c--;
}
if(!c) root=i;
else r[S[c]]=i;
S[++c]=i;
}
return root;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
248 KB |
Output is correct |
2 |
Correct |
10 ms |
436 KB |
Output is correct |
3 |
Correct |
9 ms |
436 KB |
Output is correct |
4 |
Correct |
10 ms |
464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
104 ms |
492 KB |
Output is correct |
2 |
Correct |
76 ms |
620 KB |
Output is correct |
3 |
Correct |
60 ms |
624 KB |
Output is correct |
4 |
Correct |
91 ms |
656 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
91 ms |
664 KB |
Output is correct |
2 |
Correct |
75 ms |
664 KB |
Output is correct |
3 |
Correct |
72 ms |
664 KB |
Output is correct |
4 |
Correct |
64 ms |
664 KB |
Output is correct |