# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
108770 |
2019-05-01T20:14:26 Z |
MetB |
Aliens (IOI07_aliens) |
C++17 |
|
5 ms |
384 KB |
#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;
ll n, x, y, min_x, max_x, min_y, max_y;
bool query (ll x, ll 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--;
ll m = max_x - min_x + 1;
x = (min_x + max_x) / 2;
y = (min_y + max_y) / 2;
ll x_c = x - 2 * m;
ll 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);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Incorrect |
3 ms |
256 KB |
Incorrect |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
4 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
256 KB |
Output is correct |
2 |
Correct |
3 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Incorrect |
4 ms |
256 KB |
Incorrect |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Incorrect |
5 ms |
256 KB |
too many queries |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
256 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |