# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
436111 |
2021-06-24T08:58:56 Z |
dutch |
Aliens (IOI07_aliens) |
C++17 |
|
5 ms |
200 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n, x, y;
bool q(int i, int j){
if(min(i, j) < 1 || max(i, j) > n) return 0;
cout << "examine " << i << ' ' << j << endl;
string res; cin >> res;
return res[0] == 't';
}
signed main(){
cin.tie(0)->sync_with_stdio(0);
cin >> n >> x >> y;
int xMax = x, xMin = x, yMax = y;
for(int i=1<<30, j; i/=2; ){
j = xMax + i;
if(q(j, y)){
j += xMax;
if(q(j/2, y) && (((j+3)/4)<=x || q((j+3)/4, y))) xMax += i;
}
j = yMax + i;
if(q(x, j)){
j += yMax;
if(q(x, j/2) && (((j+3)/4)<=y || q(x, (j+3)/4))) yMax += i;
}
j = xMin - i;
if(q(j, y)){
j += xMin;
if(q(j/2, y) && (((j+3)/4)>=x || q((j+3)/4, y))) xMin -= i;
}
}
int w = 2*(xMax - xMin + 1);
int yMin = yMax - (xMax - xMin);
x = (xMin + xMax) / 2;
y = (yMin + yMax) / 2;
xMin = xMax = x;
yMin = yMax = y;
if(q(x-w, y)) xMin -= w;
if(q(x-w, y)) xMin -= w;
if(q(x+w, y)) xMax += w;
if(q(x+w, y)) xMax += w;
if(q(x, y-w)) yMin -= w;
if(q(x, y-w)) yMin -= w;
if(q(x, y+w)) yMax += w;
if(q(x, y+w)) yMax += w;
cout << "solution " << (xMin+xMax)/2 << ' ' << (yMin+yMax)/2 << endl;
}
# |
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 |
Correct |
2 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Incorrect |
2 ms |
200 KB |
Incorrect |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Incorrect |
2 ms |
200 KB |
Incorrect |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 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 |
1 ms |
200 KB |
Output is correct |
2 |
Incorrect |
3 ms |
200 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
200 KB |
Output is correct |
2 |
Incorrect |
5 ms |
200 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |