# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
61916 |
2018-07-27T05:13:26 Z |
김세빈(#1797) |
popa (BOI18_popa) |
C++11 |
|
128 ms |
612 KB |
#include "popa.h"
int S[1010], D[1010];
int solve(int n, int* L, int* R)
{
int i, j, k, s;
s = 0;
for(i=0; i<n; i++){
L[i] = R[i] = -1;
D[i] = i;
for(j=s; j && query(D[S[j]], i, i, i); j--);
for(k=j+1; k<s; k++) R[S[k]] = S[k + 1];
if(j + 1 <= s){
L[i] = S[j + 1];
D[i] = D[S[j + 1]];
}
s = j + 1; S[s] = i;
}
for(i=1; i<s; i++) R[S[i]] = S[i + 1];
return S[1];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
376 KB |
Output is correct |
2 |
Correct |
14 ms |
376 KB |
Output is correct |
3 |
Correct |
12 ms |
376 KB |
Output is correct |
4 |
Correct |
11 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
117 ms |
512 KB |
Output is correct |
2 |
Correct |
107 ms |
612 KB |
Output is correct |
3 |
Correct |
76 ms |
612 KB |
Output is correct |
4 |
Correct |
128 ms |
612 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
100 ms |
612 KB |
Output is correct |
2 |
Correct |
122 ms |
612 KB |
Output is correct |
3 |
Correct |
52 ms |
612 KB |
Output is correct |
4 |
Correct |
70 ms |
612 KB |
Output is correct |