#include<iostream>
#include<popa.h>
using namespace std;
int myway(int l,int r,int* Left,int* Right){
if(l>r) return -1;
if(l==r){
Left[l]=-1;
Right[l]=-1;
return l;
}
int g=-1;
for(int i=l; i<=r; i++){
if(query(l,i,i,r)==1){
Left[i]=myway(l,i-1,Left,Right);
Right[i]=myway(i+1,r,Left,Right);
g=i;
break;
}
}
return g;
}
int solve(int N,int* Left,int* Right){
int h=-1;
for(int i=0; i<N; i++){
if(query(0,i,i,N-1)){
h=i;
break;
}
}
myway(0,N-1,Left,Right);
return h;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
70 ms |
248 KB |
Output is correct |
2 |
Correct |
105 ms |
312 KB |
Output is correct |
3 |
Correct |
23 ms |
376 KB |
Output is correct |
4 |
Correct |
91 ms |
376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
304 ms |
324 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
27 ms |
248 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |