#include <bits/stdc++.h>
using namespace std;
long long n,x,y,m;
bool examine(long long x,long long y)
{
if(x>n or x<1 or y>n or y<1) return false;
cout << "examine " << x << ' ' << y;
cout << flush;
string s;
cin >> s;
if(s=="true") return true;
else return false;
}
long long solve(int ax,int ay)
{
long long mul = 1;
while(examine(x+ax*mul,y+ay*mul)) mul*=2;
long long l = mul/2,r = mul;
while(l<r)
{
long long m = (l+r)/2;
if(examine(x+ax*m,y+ay*m)) l = m;
else r = m-1;
}
return l;
}
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n >> x >> y;
long long lf = solve(0,-1),rg = solve(0,1),up = solve(-1,0);
m = lf+rg+1;
x-=lf,y-=up;
while(examine(x,y)) x-=m,y-=m;
while(examine(x,y)) x-=m*2;
while(examine(x,y)) y-=m*2;
cout << "solution " << x+m*2+1 << ' ' << y+m*2+1;
cout << flush;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
304 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
412 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
256 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
256 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3 ms |
384 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
384 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
256 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
384 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
384 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3 ms |
384 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |