#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) {
if (1 <= r && 1 <= c && r <= n && c <= n) {
cnt++;
if (cnt > 300 - 1) exit(0);
cout << "examine " << r << " " << c << endl;
string s;
cin >> s;
assert(s == "true" || s == "false");
return (s == "true");
}
return false;
};
for (int k = 0; k < 3; 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});
}
guys.push_back({-1, guys[1].second - guys[2].first + guys[0].first});
cout << "solution ";
cout << (guys[0].first + guys[2].first) / 2 << " ";
cout << (guys[1].second + guys[3].second) / 2 << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
1 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
1 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
2 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
2 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
2 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
4 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
1 ms |
200 KB |
Output is correct |
3 |
Correct |
1 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
200 KB |
Output is correct |
2 |
Correct |
2 ms |
200 KB |
Output is correct |
3 |
Correct |
3 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
200 KB |
Output is correct |
2 |
Correct |
1 ms |
200 KB |
Output is correct |
3 |
Correct |
3 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
200 KB |
Output is correct |
2 |
Correct |
2 ms |
200 KB |
Output is correct |
3 |
Correct |
2 ms |
200 KB |
Output is correct |