답안 #208535

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
208535 2020-03-11T13:19:03 Z dolphingarlic popa (BOI18_popa) C++14
100 / 100
97 ms 500 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;}
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 252 KB Output is correct
2 Correct 16 ms 248 KB Output is correct
3 Correct 14 ms 248 KB Output is correct
4 Correct 12 ms 248 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 92 ms 248 KB Output is correct
2 Correct 96 ms 376 KB Output is correct
3 Correct 58 ms 376 KB Output is correct
4 Correct 86 ms 316 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 89 ms 500 KB Output is correct
2 Correct 82 ms 320 KB Output is correct
3 Correct 86 ms 420 KB Output is correct
4 Correct 97 ms 248 KB Output is correct