#include <bits/stdc++.h>
using namespace std;
bool ask(int x, int y){
cout << "examine " << x << " " << y << endl;
string str; cin >> str;
if (str == "true") return true;
else return false;
}
int main() {
int n, x0, y0; cin >> n >> x0 >> y0;
int xt = x0, yt = y0, xb = x0, yb = y0;
while (xt > 1 && ask(xt-1, y0)) xt--;
while (xb < n && ask(xb+1, y0)) xb++;
while (yt > 1 && ask(x0, yt-1)) yt--;
while (yb < n && ask(x0, yb+1)) yb++;
int sz = xb - xt + 1;
while (xt - 2*sz >= 1 && ask(xt - 2*sz, yt)) xt = xt - 2*sz;
while (true){
if (xt - sz >= 1 && yt - sz >= 1 && ask(xt - sz, yt - sz)) xt = xt - sz, yt = yt - sz;
else if (xt + sz <= n && yt - sz >= 1 && ask(xt + sz, yt - sz)) xt = xt + sz, yt = yt - sz;
else break;
}
int xres = xt + 2*sz + sz / 2;
int yres = yt + 2*sz + sz / 2;
cout << "solution " << xres << " " << yres << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
2 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
208 KB |
Output is correct |
2 |
Correct |
3 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
3 ms |
256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
4 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Runtime error |
3 ms |
208 KB |
Execution killed with signal 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Runtime error |
3 ms |
208 KB |
Execution killed with signal 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
4 ms |
336 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
4 ms |
292 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |