#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, x, y;
string a;
cin >> n >> x >> y;
long long l = 0, r = 0, b1, b2;
b1 = x, b2 = n;
while(b1 != b2){
int mid = (b1+b2+1)/2;
cout << "examine " << mid << ' ' << y << '\n' << flush;
cin >> a;
if(a == "true") b1 = mid;
else b2 = mid-1;
}
r = b1;
b1 = 1, b2 = x;
while(b1 != b2){
int mid = (b1+b2)/2;
cout << "examine " << mid << ' ' << y << '\n' << flush;
cin >> a;
if(a == "true") b2 = mid;
else b1 = mid+1;
}
l = b1;
cout << "examine " << (l+r)/2 << ' ' << y << '\n' << flush;
cin >> a;
if(a == "false") r = (r+2*l-2)/3;
else{
cout << "examine " << l+((r-l+1)*3/10) << ' ' << y << '\n' << flush;
cin >> a;
if(a == "false") r = (r+4*l-4)/5;
}
int m = r-l+1;
// cout << m << endl;
b1 = max(1, y-m+1), b2 = y;
while(b1 != b2){
int mid = (b1+b2)/2;
cout << "examine " << x << ' ' << mid << '\n' << flush;
cin >> a;
if(a == "true") b2 = mid;
else b1 = mid+1;
}
long long cx = (r+l)/2, cy = b1 + m/2;
if(cx + m <= n && cy + m <= n){
cout << "examine " << cx + m << ' ' << cy + m << '\n' << flush;
cin >> a;
if(a == "false"){
cx -= m;
cy -= m;
}
}
else{
cx -= m;
cy -= m;
}
if(cx + m <= n && cy - m >= 1){
cout << "examine " << cx + m << ' ' << cy - m << '\n' << flush;
cin >> a;
if(a == "false"){
cx -= m;
cy += m;
}
}
else{
cx -= m;
cy += m;
}
if(cx - m >= 1 && cy + m <= n){
cout << "examine " << cx - m << ' ' << cy + m << '\n' << flush;
cin >> a;
if(a == "false"){
cx += m;
cy -= m;
}
}
else{
cx += m;
cy -= m;
}
if(cx - m >= 1 && cy - m >= 1){
cout << "examine " << cx - m << ' ' << cy - m << '\n' << flush;
cin >> a;
if(a == "false"){
cx += m;
cy += m;
}
}
else{
cx += m;
cy += m;
}
int xx = 0, yy = 0;
if(cx - 2*m >= 1 && cy - 2*m >= 1){
cout << "examine " << cx - 2*m << ' ' << cy - 2*m << '\n' << flush;
cin >> a;
if(a == "true"){
xx -= m;
yy -= m;
}
}
if(cx + 2*m <= n && cy - 2*m >= 1){
cout << "examine " << cx + 2*m << ' ' << cy - 2*m << '\n' << flush;
cin >> a;
if(a == "true"){
xx += m;
yy -= m;
}
}
if(cx - 2*m >= 1 && cy + 2*m <= n){
cout << "examine " << cx - 2*m << ' ' << cy + 2*m << '\n' << flush;
cin >> a;
if(a == "true"){
xx -= m;
yy += m;
}
}
if(cx + 2*m >= 1 && cy + 2*m >= 1){
cout << "examine " << cx + 2*m << ' ' << cy + 2*m << '\n' << flush;
cin >> a;
if(a == "true"){
xx += m;
yy += m;
}
}
cout << "solution " << cx + xx << ' ' << cy + yy << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
2 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
2 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
2 ms |
396 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
2 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |