# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
507961 |
2022-01-13T04:54:35 Z |
ac2hu |
Aliens (IOI07_aliens) |
C++14 |
|
5 ms |
216 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int M = 31623;
const int N = 2'000'000'000;
bool check(int i,int j,int n){
if(i >0 && j >0 && i <= n && j <= n){
cout << "examine " << i << " " << j << endl;
string s;cin >> s;
fflush(stdout);
return ((s == "true")? true : false);
}
return 0;
}
signed main(){
int n,x,y;cin >> n >> x >> y;
int rx = x;
for( ;rx<=n;rx++){
if(!check(rx,y,n)){
break;
}
}
rx--;
int ry = y;
for(;ry<=n;ry++)
if(!check(rx,ry,n))
break;
ry--;
int l = 0,r = n - max(rx,ry);
while(l < r){
int mid = (l + r + 1)/2;
if(check(rx + mid, ry + mid,n))
l = mid;
else
r = mid - 1;
}
pair<int,int> topcorner = {rx + l, ry + l};
l = 0,r = min(rx,ry) - 1;
while(l < r){
int mid = (l + r + 1)/2;
if(check(rx - mid,ry - mid, n))
l = mid;
else
r = mid - 1;
}
pair<int,int> bottomcorner = {rx - l,ry - l};
// cout << topcorner.first << " " << topcorner.second << endl;
// cout << bottomcorner.first << " " << bottomcorner.second << endl;
pair<int,int> center = {(topcorner.first + bottomcorner.first)/2,(topcorner.second + bottomcorner.second)/2};
cout << "solution " << center.first << " " << center.second << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
Incorrect |
1 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
200 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
200 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Runtime error |
5 ms |
200 KB |
Execution killed with signal 13 |
# |
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 |
Runtime error |
4 ms |
216 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
200 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
200 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |