# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
896009 |
2023-12-31T12:21:41 Z |
Andrey |
Aliens (IOI07_aliens) |
C++14 |
|
2 ms |
592 KB |
#include<bits/stdc++.h>
using namespace std;
long long n;
bool query(long long x, long long y) {
if(x < 1 || x > n || y < 1 || y > n) {
return false;
}
string s;
cout << "examine " << x << " " << y << endl;
cin >> s;
if(s == "false") {
return false;
}
else {
return true;
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long x,y;
cin >> n >> x >> y;
long long r = x,c,l = x,u = y;
for(int i = 0; i < 31; i++) {
c = i;
if(!query(r+(1 << i),y)) {
break;
}
}
for(int i = c; i >= 0; i--) {
if(query(r+(1 << i),y)) {
r+=(1 << i);
}
}
c = 0;
for(int i = 0; i < 31; i++) {
c = i;
if(!query(l-(1 << i),y)) {
break;
}
}
for(int i = c; i >= 0; i--) {
if(query(l-(1 << i),y)) {
l-=(1 << i);
}
}
long long m = r-l+1;
c = 0;
for(int i = 0; i < 31; i++) {
c = i;
if(!query(x,u+(1 << i))) {
break;
}
}
for(int i = c; i >= 0; i--) {
if(query(x,u+(1 << i))) {
u+=(1 << i);
}
}
long long d = u-m+1;
x = (l+r)/2,y = (u+d)/2;
long long sb1 = 0,sb2 = 0;
for(int i = -4; i <= 4; i++) {
for(int j = -4; j <= 4; j++) {
if(query(x+i*m,y+j*m)) {
sb1+=x+i*m;
sb2+=y+i*m;
}
}
}
cout << "solution " << sb1/13 << " " << sb2/13 << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
592 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
344 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
344 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
512 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Incorrect |
1 ms |
344 KB |
Incorrect |
4 |
Halted |
0 ms |
0 KB |
- |