#include "popa.h"
#include <iostream>
using namespace std;
const int nmax=1005;
int st[nmax];
int u,i;
int solve(int N, int* Left, int* Right)
{
int root=0;
u=0;
for(i=0;i<N;i++)
{
Left[i]=Right[i]=-1;
while(u&&query(st[u],i,i,i))
{
Right[st[u]]=Left[i];
Left[i]=st[u];
u--;
}
if(u) Right[st[u]]=i;
else root=i;
st[++u]=i;
}
return root;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
384 KB |
Output is correct |
2 |
Correct |
11 ms |
384 KB |
Output is correct |
3 |
Correct |
12 ms |
388 KB |
Output is correct |
4 |
Correct |
13 ms |
444 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
77 ms |
648 KB |
Output is correct |
2 |
Correct |
111 ms |
648 KB |
Output is correct |
3 |
Correct |
69 ms |
648 KB |
Output is correct |
4 |
Correct |
91 ms |
700 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
105 ms |
700 KB |
Output is correct |
2 |
Correct |
89 ms |
700 KB |
Output is correct |
3 |
Correct |
43 ms |
700 KB |
Output is correct |
4 |
Correct |
62 ms |
700 KB |
Output is correct |