#include <bits/stdc++.h>
#define int signed
using namespace std;
int n, x, y, m, bl, br, xl, xr, yl, yr;
string s;
int pow2[50];
signed main() {
cin >> n >> x >> y;
pow2[0] = 1;
for(int i=1; i<50; i++) {
pow2[i] = pow2[i-1] * 2;
}
for(int i=0; i<n; i++) {
bl = i == 0 ? x : x + pow2[i-1];
br = x + pow2[i];
cout << "examine " << br << " " << y << endl;
cin >> s;
if(s[0] == 'f') break;
}
while(bl < br) {
int mid = bl + (br-bl)/2;
cout << "examine " << mid << " " << y << endl;
cin >> s;
if(s[0] == 't') {
bl = mid+1;
} else {
br = mid;
}
}
xr = bl-1;
for(int i=0; i<n; i++) {
bl = i == 0 ? x : x - pow2[i-1];
br = x - pow2[i];
cout << "examine " << x-pow2[i] << " " << y << endl;
cin >> s;
if(s[0] == 'f') break;
}
while(bl < br) {
int mid = bl + (br-bl)/2;
cout << "examine " << x-mid << " " << y << endl;
cin >> s;
if(s[0] == 't') {
bl = mid+1;
} else {
br = mid;
}
}
xl = bl;
m = xr-xl+1;
bl = 0, br = m;
while(bl < br) {
int mid = bl + (br-bl)/2;
cout << "examine " << x << " " << y+mid << endl;
cin >> s;
if(s[0] == 't') {
bl = mid+1;
} else {
br = mid;
}
}
yr = y+bl-1;
yl = yr-m+1;
int cx = (xl+xr)/2;
int cy = (yl+yr)/2;
int rb=0, ub=0;
for(int i=4; i>0; i--) {
for(int j=-1; j<2; j++) {
cout << "examine " << cx+(i*m) << " " << cy+(j*m) << endl;
cin >> s;
if(s[0] == 't') {
rb = i;
goto jump;
}
}
}
jump:;
for(int i=4; i>0; i--) {
for(int j=-1; j<2; j++) {
cout << "examine " << cx+(j*m) << " " << cy+(i*m) << endl;
cin >> s;
if(s[0] == 't') {
ub = j;
goto jump2;
}
}
}
jump2:;
cout << cx+((rb-2)*m) << " " << n-cy+((ub-2)*m)+1 << "\n";
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
352 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
356 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
356 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
356 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
356 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
352 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
356 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
356 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
352 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |