This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void flush()
{
cout.flush();
}
bool examine(int x, int y)
{
cout << "examine " << x << " " << y << endl;
flush();
string response;
cin >> response;
return response == "true";
}
int main()
{
int N, X0, Y0;
cin >> N >> X0 >> Y0;
int M = 3;
int low = 3, high = N;
while (low <= high)
{
int mid = (low + high) / 2;
bool found = true;
for (int i = -mid / 2; i <= mid / 2; i++)
{
for (int j = -mid / 2; j <= mid / 2; j++)
{
int x = X0 + i * mid;
int y = Y0 + j * mid;
if (x < 1 || x > N || y < 1 || y > N || !examine(x, y))
{
found = false;
break;
}
}
if (!found)
break;
}
if (found)
{
M = mid;
break;
}
high = mid - 1;
}
int offset = (M * 5) / 2;
int XC = X0 + offset;
int YC = Y0 + offset;
cout << "solution " << XC << " " << YC << endl;
flush();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |