#include <bits/stdc++.h>
using namespace std;
#define int long long
// solution is binary search... a lot.
int n,x,y;
int i,j;
int cnt = 1;
int t;
int ansx,ansy;
bool examine(int k, int l) {
string result;
cout<<"examine "<<k<<' '<<l<<endl;
cin>>result;
if (result == "true") {
return true;
}
else {
return false;
}
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin>>n>>x>>y;
i = x; j = y;
while (i<=n and examine(i,y)) {
i+=1;
}
while (x>0 and examine(x,y)) {
x-=1;
}
x+=1;
int m = i-x;
while (x<=n and examine(x,y)) {
x+=2*m;
cnt+=1;
}
i-=1;
if (cnt==1) {
if (examine(i-4*m,y)) {
t = 3;
ansx = i - 2*m - (m+1)/2;
//im on a black tile
}
else {
t = 2;
ansx = i - m - (m+1)/2;
//im on a white tile
}
}
else if (cnt == 2) {
if (examine(i-2*m,y)) {
t = 3;
ansx = i - (m+1)/2;
//im on a black tile
}
else {
t = 2;
ansx = i+(m+1)/2;
//im on a white tile
}
}
else {
t = 3;
ansx = i + m + (m+1)/2;
//im on a black tile
}
cnt = 1;
if (t==3) {
while (j>=1 and examine(ansx,j)) {
j-=1;
}
j+=1;
}
else {
while (j<=n and examine(ansx,j)==false) {
j+=1;
}
j-=1;
}
while (j<=n and examine(ansx,j)) {
j+=2*m;
cnt+=1;
}
ansy = j-3*m-(m+1)/2;
/* if (cnt == 1) {
if (examine(ansx,j-4*m)) {
t = 3;
ansy = j - m - (m+1)/2;
}
else {
t = 2;
ansy = j - (m+1)/2;
}
}
else if (cnt == 2) {
if (examine(ansx,j-2*m)) {
t = 3;
ansy = j + (m-1)/2;
}
else {
t = 2;
ansy = j + m + (m+1)/2;
}
}
else {
t = 3;
ansy = j - m - (m+1)/2;
}*/
cout<<"solution "<<ansx<<' '<<ansy;
return 0;
}
# | 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... |