#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <cstring>
#warning That's the baby, that's not my baby
typedef long long ll;
bool is_local = false;
int localN = 19, localM = 3;
int x1 = 4, y1 = 5, x2 = 18, y2 = 19;
bool answerLocal(int x, int y) {
return (x1 <= x && x <= x2 && y1 <= y && y <= y2);
}
bool ask(int x, int y) {
std::cout << "examine " << x << ' ' << y << std::endl;
if (is_local) {
return answerLocal(x, y);
}
std::string s;
std::cin >> s;
return (s == "true"? 1 : 0);
}
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(0);
int n, x0, y0;
std::cin >> n >> x0 >> y0;
int l = 1, r = x0;
while (l < r) {
int mid = (l + r) / 2;
if (ask(mid, y0)) {
r = mid;
} else {
l = mid + 1;
}
}
int x1 = r;
l = x0, r = n;
while (l < r) {
int mid = (l + r + 1) / 2;
if (ask(mid, y0)) {
l = mid;
} else {
r = mid - 1;
}
}
int x2 = r;
int m = x2 - x1 + 1;
l = 1, r = y0;
while (l < r) {
int mid = (l + r) / 2;
if (ask(x0, mid)) {
r = mid;
} else {
l = mid + 1;
}
}
int y1 = r;
int y2 = y1 + m - 1;
std::cout << "solution " << (x1 + x2) / 2 << ' ' << (y1 + y2) / 2;
return 0;
}
Compilation message
aliens.cpp:6:2: warning: #warning That's the baby, that's not my baby [-Wcpp]
6 | #warning That's the baby, that's not my baby
| ^~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
544 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Runtime error |
1 ms |
448 KB |
Execution killed with signal 13 |
3 |
Halted |
0 ms |
0 KB |
- |