# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
521586 |
2022-02-02T13:44:06 Z |
qwerasdfzxcl |
Park (JOI17_park) |
C++14 |
|
157 ms |
512 KB |
#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(i, 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];
}
void Detect(int T, int N) {
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]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Wrong Answer[2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
157 ms |
460 KB |
Wrong Answer[2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
131 ms |
512 KB |
Wrong Answer[2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
69 ms |
332 KB |
Wrong Answer[2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
145 ms |
428 KB |
Wrong Answer[2] |
2 |
Halted |
0 ms |
0 KB |
- |