# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
28626 | ㅁㄴㅇㄹ (#68) | LR Springboard (FXCUP2_springboard) | C++14 | 3 ms | 2348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "springboard.h"
#include <bits/stdc++.h>
using namespace std;
int l[20000],r[20000],tl[20000],tr[20000];
void Reorder(int N) {
int in = N;
for(int i=1; i<=N; i++){
l[i] = r[i] = i;
}
int get,rear;
while(N != 1){
int m = (N+1)/2;
get = PutBall(l[m]);
if(get == -1){
rear = 1;
tl[1] = l[1]; tr[1] = l[m];
if(l[m] != r[m]){
rear++;
tl[rear] = l[m]+1;
tr[rear] = r[m];
}
for(int i=m+1; i<=N; i++){
rear++;
tl[rear] = l[i];
tr[rear] = r[i];
}
N = rear;
}else{
rear = 0;
for(int i=1; i<m; i++){
rear++;
tl[rear] = l[i];
tr[rear] = r[i];
}
rear++;
tl[rear] = l[m];
tr[rear] = r[N];
N = rear;
}
}
get = PutBall(1);
if(get == -1){
PutBall(in);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |