# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
249882 |
2020-07-16T08:47:58 Z |
WLZ |
Aliens (IOI07_aliens) |
C++14 |
|
4 ms |
384 KB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
long long n, x_0, y_0;
cin >> n >> x_0 >> y_0;
for (int i = 1; i <= 400; i++) {
cout << "examine 1 1" << endl;
string s;
cin >> s;
}
int k = -1;
string s;
do {
k++;
cout << "examine " << x_0 + (1ll << k) << ' ' << y_0 << endl;
cin >> s;
} while (s == "true");
long long lo = x_0, hi = x_0 + (1ll << k);
while (lo < hi) {
long long mid = (lo + hi + 1) / 2;
cout << "examine " << mid << ' ' << y_0 << endl;
cin >> s;
if (s == "true") {
lo = mid;
} else {
hi = mid - 1;
}
}
long long x_r = lo;
k = -1;
do {
k++;
cout << "examine " << x_0 << ' ' << y_0 + (1ll << k) << endl;
cin >> s;
} while (s == "true");
lo = y_0, hi = y_0 + (1ll << k);
while (lo < hi) {
long long mid = (lo + hi + 1) / 2;
cout << "examine " << x_0 << ' ' << mid << endl;
cin >> s;
if (s == "true") {
lo = mid;
} else {
hi = mid - 1;
}
}
long long y_r = lo;
k = -1;
do {
k++;
cout << "examine " << x_0 - (1ll << k) << ' ' << y_0 << endl;
cin >> s;
} while (s == "true");
lo = x_0 - (1ll << k), hi = x_0;
while (lo < hi) {
long long mid = (lo + hi) / 2;
cout << "examine " << mid << ' ' << y_0 << endl;
cin >> s;
if (s == "true") {
hi = mid;
} else {
lo = mid + 1;
}
}
long long x_l = lo;
long long m = x_r - x_l + 1;
x_0 = x_r - (m - 1) / 2;
y_0 = y_r - (m - 1) / 2;
vector<bool> x(5, false);
for (int i = -2; i <= 2; i++) {
if (x_0 + 2 * i * m < 1 || x_0 + 2 * i * m > n) {
continue;
}
cout << "examine " << x_0 + 2 * i * m << ' ' << y_0 << endl;
cin >> s;
x[i + 2] = (s == "true");
}
vector<bool> y(5, false);
for (int i = -2; i <= 2; i++) {
if (y_0 + 2 * i * m < 1 || y_0 + 2 * i * m > n) {
continue;
}
cout << "examine " << x_0 << ' ' << y_0 + 2 * i * m << endl;
cin >> s;
y[i + 2] = (s == "true");
}
if (x[3] && x[4]) {
x_0 += 2 * m;
} else if (x[0] && x[1]) {
x_0 -= 2 * m;
} else if (x[1] && !x[3]) {
x_0 -= m;
} else {
x_0 += m;
}
if (y[3] && y[4]) {
y_0 += 2 * m;
} else if (y[0] && y[1]) {
y_0 -= 2 * m;
} else if (y[1] && !y[3]) {
y_0 -= m;
} else {
y_0 += m;
}
cout << "solution " << x_0 << ' ' << y_0 << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
4 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
too many queries |
2 |
Halted |
0 ms |
0 KB |
- |