#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 |
1 |
Incorrect |
3 ms |
2348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |