# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1009125 |
2024-06-27T09:03:30 Z |
ALTAKEXE |
Aliens (IOI07_aliens) |
C++17 |
|
2 ms |
436 KB |
#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 |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
436 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |