# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1107270 |
2024-11-01T05:36:04 Z |
jadai007 |
Aliens (IOI07_aliens) |
C++17 |
|
2 ms |
336 KB |
#include<bits/stdc++.h>
using namespace std;
int n, xo, yo;
string ck;
bool check(int x, int y){
if(x < 1 || x > n || y < 1 || y > n) return false;
cout << "examine " << x << ' ' << y << endl;
cin >> ck;
if(ck == "false") return false;
return true;
}
int main(){
cin >> n >> xo >> yo;
int lx = xo, ly = yo, x = xo, y = yo;
for(int i = 31; i >= 0; --i){
x = lx - (1<<i), y = ly;
if(check(x, y)) lx = x, ly = y;
}
for(int i = 31; i >= 0; --i){
x = lx, y = ly - (1<<i);
if(check(x, y)) lx = x, ly = y;
}
for(int i = 31; i >= 0; --i){
x = lx - (1<<i), y = ly - (1<<i);
if(check(x, y)) lx = x, ly = y;
}
int rx = lx, ry = ly;
for(int i = 31; i >= 0; --i){
int cx = rx + (1<<i);
if(check(cx, ly)) rx = cx;
}
for(int i = 31; i >= 0; --i){
int cy = ry + (1<<i);
if(check(lx, cy)) ry = cy;
}
cout << "solution " << (lx + rx)/2 << ' ' << (ly + ry)/2 << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Incorrect |
2 ms |
336 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Incorrect |
2 ms |
336 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |