# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
430922 |
2021-06-17T08:00:10 Z |
tengiz05 |
Aliens (IOI07_aliens) |
C++17 |
|
2 ms |
200 KB |
#include <bits/stdc++.h>
using i64 = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
i64 n, x, y;
std::cin >> n >> x >> y;
auto ask = [&](i64 x, i64 y) {
if (x <= 0 || y <= 0 || x > n || y > n) {
return false;
}
std::cout << "examine " << x << " " << y << std::endl;
std::string res;
std::cin >> res;
return res == "true";
};
for (int i = 2; ; i *= 2) {
if (!ask(x, y + i)) {
for (int j = i / 2; j > 0; j /= 2) {
if (ask(x, y + j)) {
y += j;
}
}
break;
}
}
for (int i = 2; ; i *= 2) {
if (!ask(x + i, y)) {
for (int j = i / 2; j > 0; j /= 2) {
if (ask(x + j, y)) {
x += j;
}
}
break;
}
}
i64 X = x, Y = y;
for (int i = 2; ; i *= 2) {
if (!ask(X, Y - i)) {
for (int j = i / 2; j > 0; j /= 2) {
if (ask(X, Y - j)) {
Y -= j;
}
}
break;
}
}
i64 len = y - Y + 1;
// std::cout << X << " " << Y << "\n";
// std::cout << len << std::endl;
while (ask(x, y + len * 2)) {
y += len * 2;
}
while (ask(x + len * 2, y)) {
x += len * 2;
}
std::cout << "solution " << x - len * 2 - len / 2 << " " << y - len * 2 - len / 2 << std::endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Incorrect |
1 ms |
200 KB |
Incorrect |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
1 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
1 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Incorrect |
1 ms |
200 KB |
Incorrect |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Incorrect |
1 ms |
200 KB |
Incorrect |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Incorrect |
1 ms |
200 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Incorrect |
2 ms |
200 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
200 KB |
Output is correct |
2 |
Correct |
2 ms |
200 KB |
Output is correct |
3 |
Correct |
1 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
200 KB |
Output is correct |
2 |
Correct |
2 ms |
200 KB |
Output is correct |
3 |
Incorrect |
2 ms |
200 KB |
Incorrect |