#include <iostream>
#include <cstdlib>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <bitset>
#include <queue>
#include <math.h>
#include <stack>
#include <vector>
#include <string.h>
#include <random>
typedef long long ll;
const ll MOD = 1e9 + 7, INF = 1e18;
using namespace std;
int n, x, y, min_x, max_x, min_y, max_y;
bool query (int x, int y)
{
cout << "examine " << x << ' ' << y << endl;
fflush (stdout);
string s;
cin >> s;
if (s == "true") return true;
else return false;
}
int main ()
{
cin >> n >> x >> y;
max_x = min_x = x;
max_y = min_y = y;
while (query (max_x, y)) max_x++;
while (query (min_x, y)) min_x--;
while (query (x, max_y)) max_y++;
while (query (x, min_y)) min_y--;
min_x++;
max_x--;
min_y++;
max_y--;
int m = max_x - min_x + 1;
x = (min_x + max_x) / 2;
y = (min_y + max_y) / 2;
int x_c = x - 2 * m;
int y_c = y - 2 * m;
if (query (x + 2 * m, y)) x_c += 2 * m;
if (query (x + 4 * m, y)) x_c += 2 * m;
if (query (x, y + 2 * m)) y_c += 2 * m;
if (query (x, y + 4 * m)) y_c += 2 * m;
cout << "solution " << x_c << ' ' << y_c << endl;
fflush (stdout);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Incorrect |
2 ms |
256 KB |
Incorrect |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
4 ms |
256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
256 KB |
Output is correct |
2 |
Correct |
4 ms |
512 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Incorrect |
2 ms |
384 KB |
Incorrect |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
384 KB |
Output is correct |
2 |
Incorrect |
4 ms |
256 KB |
too many queries |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
252 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
284 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |