#include<bits/stdc++.h>
#define int long long
using namespace std;
int n, xo, yo;
string ck;
bool check(int x, int y){
if(x < 1 || x > n || y < 1 || y > n) return false;
cout << "examine " << x << ' ' << y << endl;
cin >> ck;
if(ck == "false") return false;
return true;
}
int32_t main(){
cin >> n >> xo >> yo;
int lx = xo, ly = yo, x, y;
for(int j = 0; j < 3; ++j){
for(int i = 31; i >= 0; --i){
x = lx - (1ll<<i), y = ly;
if(check(x, y)) lx = x, ly = y;
}
}
for(int j = 0; j < 3; ++j){
for(int i = 31; i >= 0; --i){
x = lx, y = ly - (1ll<<i);
if(check(x, y)) lx = x, ly = y;
}
}
for(int i = 31; i >= 0; --i){
x = lx - (1<<i), y = ly - (1ll<<i);
if(check(x, y)) lx = x, ly = y;
}
int m = 0ll;
x = lx, y = ly;
for (int i = 31; i >= 0; i--) {
if (check(x + (1ll<<i), y + (1ll<<i))) m += (1ll<<i), x += (1ll<<i), y += (1ll<<i);
}
cout << "solution " << lx + m/2 << " " << ly + m/2 << endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
336 KB |
Output is correct |
3 |
Correct |
2 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
336 KB |
Output is correct |
3 |
Correct |
2 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
336 KB |
Output is correct |
2 |
Correct |
2 ms |
336 KB |
Output is correct |
3 |
Correct |
2 ms |
336 KB |
Output is correct |