#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;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
# |
결과 |
실행 시간 |
메모리 |
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 |
# |
결과 |
실행 시간 |
메모리 |
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 |