#include "park.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
static int Place[1400];
int a[2020];
int ask(int x, int y){return Ask(min(x, y), max(x, y), Place);}
void answer(int x, int y){Answer(min(x, y), max(x, y));}
bool cmp(int x, int y){
fill(Place, Place+1400, 1);
Place[y] = 0;
if (!ask(0, x)) return 0;
return 1;
}
int tmp[2020];
void _sort(int l, int r){
if (l>=r) return;
int m = (l+r)>>1;
_sort(l, m); _sort(m+1, r);
int pt = m+1, cnt = l;
for (int i=l;i<=m;i++){
while(pt<=r && !cmp(a[i], a[pt])){
tmp[cnt] = a[pt];
pt++, cnt++;
}
tmp[cnt] = a[i];
cnt++;
}
while(pt<=r){
tmp[cnt] = a[pt];
pt++, cnt++;
}
for (int i=l;i<=r;i++) a[i] = tmp[i];
//printf("%d %d: ", l, r);
//for (int i=l;i<=r;i++) printf("%d ", a[i]);
//printf("\n");
}
void Detect(int T, int N) {
//printf(" 2 3: %d\n", cmp(2, 3));
for (int i=1;i<N;i++) a[i] = i;
_sort(1, N-1);
//for (int i=0;i<N;i++) printf("%d ", a[i]);
for (int i=0;i<N-1;i++) answer(a[i], a[i+1]);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Wrong Answer[2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
151 ms |
436 KB |
Output is correct |
2 |
Correct |
45 ms |
528 KB |
Output is correct |
3 |
Correct |
44 ms |
452 KB |
Output is correct |
4 |
Correct |
153 ms |
456 KB |
Output is correct |
5 |
Correct |
146 ms |
456 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
127 ms |
500 KB |
Wrong Answer[2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
72 ms |
368 KB |
Wrong Answer[2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
149 ms |
400 KB |
Wrong Answer[2] |
2 |
Halted |
0 ms |
0 KB |
- |