# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
759509 |
2023-06-16T10:58:26 Z |
rshohruh |
Aliens (IOI07_aliens) |
C++14 |
|
1 ms |
288 KB |
#include <iostream>
using namespace std;
#define int long long
int n;
bool query(int x, int y){
if(x < 1 || x > n || y < 1 || y > n) return false;
cout << "examine " << x << ' ' << y << endl;
string s;
cin >> s;
return (s == "true" ? true : false);
}
signed main(){
int X, Y;
cin >> n >> X >> Y;
int l = 1, r = X, x, y;
while(l != r){
x = (l + r) / 2;
if(query(x, Y)) r = x;
else l = x + 1;
}
int lx = l, m;
l = X;
r = n;
while(l != r){
x = (l + r + 1) / 2;
if(query(x, Y)) l = x;
else r = x - 1;
}
int rx = l;
if(!query((lx + rx) / 2, Y)) m = (rx - lx + 1) / 3;
else if(!query(lx + (rx - lx + 1) / 5, Y)) m = (rx - lx + 1) / 5;
else m = rx - lx + 1;
l = Y - m;
r = Y;
x = lx + m / 2;
while(l != r){
y = (l + r) / 2;
if(query(x, y)) r = y;
else l = y + 1;
}
y = l + m / 2;
while(query(x - 2 * m, y)) x -= 2 * m;
while(query(x, y - 2 * m)) y -= 2 * m;
x += 2 * m;
y += 2 * m;
cout << "solution " << x << ' ' << y;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Incorrect |
0 ms |
208 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Incorrect |
1 ms |
208 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Incorrect |
1 ms |
208 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Incorrect |
1 ms |
208 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Incorrect |
1 ms |
288 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
3 |
Incorrect |
1 ms |
208 KB |
Incorrect |
4 |
Halted |
0 ms |
0 KB |
- |