#include <bits/stdc++.h>
using namespace std;
#define int long long
int dr[] = {-1, 0, 1, 0};
int dc[] = {0, 1, 0, -1};
vector<pair<int, int>> guys;
signed main() {
int n, r0, c0;
cin >> n >> r0 >> c0;
int cnt = 0;
function<bool(int, int)> is = [&] (int r, int c) {
cnt++;
if (cnt > 300) exit(0);
if (1 <= r && 1 <= c && r <= n && c <= n) {
cout << "examine " << r << " " << c << endl;
string s;
cin >> s;
assert(s == "true" || s == "false");
return (s == "true");
}
return false;
};
for (int k = 0; k < 4; k++) {
int r = r0, c = c0;
while (1) {
pair<int, int> init = {r, c};
for (int step = 1 << 30; step; step /= 2) {
if (is(r + dr[k] * step, c + dc[k] * step)) {
r += dr[k] * step;
c += dc[k] * step;
}
}
pair<int, int> fini = {r, c};
if (init == fini) {
break;
}
}
guys.push_back({r, c});
}
cout << "solution ";
cout << (guys[0].first + guys[2].first) / 2 << " ";
cout << (guys[1].second + guys[3].second) / 2 << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Incorrect |
1 ms |
200 KB |
Unexpected end of file - token expected |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Incorrect |
2 ms |
200 KB |
Unexpected end of file - token expected |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
3 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
2 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Incorrect |
3 ms |
200 KB |
Unexpected end of file - token expected |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
2 ms |
200 KB |
Output is correct |
3 |
Incorrect |
2 ms |
200 KB |
Unexpected end of file - token expected |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
200 KB |
Output is correct |
2 |
Correct |
1 ms |
200 KB |
Output is correct |
3 |
Incorrect |
3 ms |
200 KB |
Unexpected end of file - token expected |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
200 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
200 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |