#include<iostream>
using namespace std;
int xx1,xx2,yy1,yy2;
signed main(){
int n,x,y; cin >> n >> x >> y;
int xx,yy;
xx1=x,yy1=y,xx2=x,yy2=y;
xx=x,yy=y;
while(true){
if(xx>n) break;
cout << "examine " << xx << " " << yy << endl;
fflush(stdout);
string str; cin >> str;
if(str=="true"){
xx2=xx;
}
else{
break;
}
++xx;
}
xx=x,yy=y;
while(true){
if(xx<1) break;
cout << "examine " << xx << " " << yy << endl;
fflush(stdout);
string str; cin >> str;
if(str=="true"){
xx1=xx;
}
else{
break;
}
--xx;
}
xx=x,yy=y;
while(true){
if(yy>n) break;
cout << "examine " << xx << " " << yy << endl;
fflush(stdout);
string str; cin >> str;
if(str=="true"){
yy2=xx;
}
else{
break;
}
++yy;
}
xx=x,yy=y;
while(true){
if(yy<1) break;
cout << "examine " << xx << " " << yy << endl;
fflush(stdout);
string str; cin >> str;
if(str=="true"){
yy1=xx;
}
else{
break;
}
--yy;
}
int m=xx2-xx1+1;
xx=xx2,yy=yy2;
int xx3,yy3;
while(true){
if(xx>n || yy>n) break;
cout << "examine " << xx << " " << yy << endl;
fflush(stdout);
string str; cin >> str;
if(str=="true"){
xx3=xx;
yy3=yy;
}
else{
break;
}
xx+=m;
yy+=m;
}
while(true){
if(xx>n || yy>n) break;
cout << "examine " << xx << " " << yy << endl;
fflush(stdout);
string str; cin >> str;
if(str=="true"){
xx3=xx;
yy3=yy;
}
else{
break;
}
yy+=2*m;
}
while(true){
if(xx>n || yy>n) break;
cout << "examine " << xx << " " << yy << endl;
fflush(stdout);
string str; cin >> str;
if(str=="true"){
xx3=xx;
yy3=yy;
}
else{
break;
}
xx+=2*m;
}
cout << "solution " << xx-2*m-(m/2) << " " << yy-2*m-(m/2);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |