#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n,x0,y0;
cin>>n>>x0>>y0;
string rep;
//do binary search to find top line of any block
int low=y0,high=n+1;
while(high-low>1){
int mid=(high+low)/2;
cout<<"examine "<<x0<<' '<<mid<<endl;
cin>>rep;
if(rep=="false")
high=mid;
else
low=mid;
}
y0=low;
low=x0,high=n+1;
while(high-low>1){
int mid=(high+low)/2;
cout<<"examine "<<mid<<' '<<y0<<endl;
cin>>rep;
if(rep=="false")
high=mid;
else
low=mid;
}
x0=low;
//want to bottom corner how must should be subtracted
low=0,high=min(x0,y0);
while(high-low>1){
int mid=(low+high)/2;
cout<<"examine "<<x0-mid<<' '<<y0-mid<<endl;
cin>>rep;
if(rep=="false")
high=mid;
else
low=mid;
}
x0-=low;
y0-=low;
low=0,high=(n+1)-max(x0,y0);
while(high-low>1){
int mid=(high+low)/2;
cout<<"examine "<<x0+mid<<' '<<y0+mid<<endl;
cin>>rep;
if(rep=="false")
high=mid;
else
low=mid;
}
x0+=low/2;
y0+=low/2;
//now we are in the main diagonal
high=min(y0,(n+1)-x0);
low=0;
while(high-low>1){
int mid=(high+low)/2;
cout<<"examine "<<x0+mid<<' '<<y0-mid<<endl;
cin>>rep;
if(rep=="false")
high=mid;
else
low=mid;
}
x0+=low;
y0-=low;
cout<<x0<<' '<<y0<<endl;
high=min(x0,(n+1)-y0);
low=0;
while(high-low>1){
int mid=(high+low)/2;
cout<<"examine "<<x0-mid<<' '<<y0+mid<<endl;
cin>>rep;
if(rep=="false")
high=mid;
else
low=mid;
}
x0-=low/2;
y0+=low/2;
cout<<"solution "<<x0<<' '<<y0<<endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
432 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
440 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
436 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
432 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
436 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
440 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
436 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
436 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
436 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
436 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |