#include <bits/stdc++.h>
#include "park.h"
using namespace std;
int *arr;
bool cmp(int i,int j){
int heh;
arr[i]=0;
if(Ask(0,j,arr)) heh = 0;
else heh = 1;
arr[i]=1;
return heh;
}
void Detect(int T, int N){
if(T==1){
arr = (int*)malloc(N*sizeof(int));
for(int i=0;i<N;i++){
for(int j=i+1;j<N;j++){
arr[i]=arr[j]=1;
if(Ask(i,j,arr)) Answer(i,j);
arr[i]=arr[j]=0;
}
}
}
else if(T==2){
arr = (int*)malloc(N*sizeof(int));
for(int i=0;i<N;i++) arr[i]=1;
int lol[2000];
for(int i=1;i<N-1;i++) lol[i-1]=i;
sort(lol,lol+N-2,cmp);
Answer(0,lol[0]);
for(int i=0;i<N-3;i++) Answer(min(lol[i],lol[i+1]),max(lol[i],lol[i+1]));
Answer(lol[N-3],N-1);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
9 ms |
384 KB |
Output is correct |
3 |
Correct |
9 ms |
384 KB |
Output is correct |
4 |
Correct |
9 ms |
384 KB |
Output is correct |
5 |
Correct |
8 ms |
384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
141 ms |
632 KB |
Output is correct |
2 |
Correct |
88 ms |
512 KB |
Output is correct |
3 |
Correct |
122 ms |
636 KB |
Output is correct |
4 |
Correct |
139 ms |
524 KB |
Output is correct |
5 |
Correct |
143 ms |
512 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
Wrong Answer[6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Wrong Answer[6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Wrong Answer[6] |
2 |
Halted |
0 ms |
0 KB |
- |