Submission #208536

# Submission time Handle Problem Language Result Execution time Memory
208536 2020-03-11T13:20:01 Z dolphingarlic popa (BOI18_popa) C++14
100 / 100
95 ms 376 KB
#include "popa.h"
int P[1000];int solve(int N,int* L,int* R){int r=-1;for(int i=0;i<N;i++){L[i]=R[i]=P[i]=-1;int p=i-1;while(p!=-1&&query(i,i,p,i)){R[p]=L[i];P[L[i]]=p;L[i]=p;int pp=P[p];P[p]=i;p=pp;}if(p==-1){L[i]=r;if(r!=-1)P[r]=i;r=i;}else R[p]=i,P[i]=p;}return r;}
# Verdict Execution time Memory Grader output
1 Correct 14 ms 248 KB Output is correct
2 Correct 12 ms 248 KB Output is correct
3 Correct 13 ms 248 KB Output is correct
4 Correct 14 ms 248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 91 ms 376 KB Output is correct
2 Correct 93 ms 248 KB Output is correct
3 Correct 58 ms 248 KB Output is correct
4 Correct 85 ms 248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 84 ms 376 KB Output is correct
2 Correct 88 ms 248 KB Output is correct
3 Correct 90 ms 248 KB Output is correct
4 Correct 95 ms 376 KB Output is correct