# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
158111 |
2019-10-14T19:33:14 Z |
faremy |
Aliens (IOI07_aliens) |
C++14 |
|
3 ms |
376 KB |
#include <iostream>
#include <algorithm>
#include <string>
bool isblack(long long x, long long y, long long size)
{
if (x < 1 || x > size || y < 1 || y > size)
return false;
std::cout << "examine " << x << ' ' << y << '\n';
std::string ans; std::cin >> ans;
if (ans == "true")
return true;
return false;
}
void center(long long x, long long y)
{
std::cout << "solution " << x << ' ' << y << '\n';
}
int main()
{
long long size, xb, yb;
std::cin >> size >> xb >> yb;
long long k = 0, xr = xb;
while (isblack(xr + (1 << k), yb, size))
k++;
k--;
for (; k > -1; k--)
if (isblack(xr + (1 << k), yb, size))
xr += (1 << k);
k = 0; long long xl = xb;
while (isblack(xl - (1 << k), yb, size))
k++;
k--;
for (; k > -1; k--)
if (isblack(xl - (1 << k), yb, size))
xl -= (1 << k);
k = 0; long long y = yb;
while (isblack(xb, y + (1 << k), size))
k++;
k--;
for (; k > -1; k--)
if (isblack(xb, y + (1 << k), size))
y += (1 << k);
long long chksize = (xr - xl + 1);
long long xc = (xl + xr) / 2;
long long yc = y - chksize / 2;
int l = isblack(xc - 2 * chksize, yc, size) + isblack(xc - 4 * chksize, yc, size);
int r = isblack(xc + 2 * chksize, yc, size) + isblack(xc + 4 * chksize, yc, size);
long long ax = xc;
if ((l + r) % 2 == 1)
{
ax += chksize;
l += 1;
}
ax += (r - l) * chksize;
l = isblack(xc, yc - 2 * chksize, size) + isblack(xc, yc - 4 * chksize, size);
r = isblack(xc, yc + 2 * chksize, size) + isblack(xc, yc + 4 * chksize, size);
long long ay = yc;
if ((l + r) % 2 == 1)
{
ay += chksize;
l += 1;
}
ay += (r - l) * chksize;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
248 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
248 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
248 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
248 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
248 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |