# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
584486 |
2022-06-27T13:02:23 Z |
Dan4Life |
Aliens (IOI07_aliens) |
C++17 |
|
4 ms |
452 KB |
#include <bits/stdc++.h>
using namespace std;
int n, m, l, r, u, d, X, Y, bx, by;
map<pair<int,int>,int> M;
int query(int x, int y){
if(x<1 or y<1 or x>n or y>n) return -1;
if(M.count({x,y})) return M[{x,y}];
cout << "examine " << x << " " << y << endl;
string s; cin >> s; return M[{x,y}]=(s=="true");
}
int32_t main()
{
ios_base::sync_with_stdio(false); cin.tie(0);
cin >> n >> X >> Y; M[{X,Y}]=1;
while(query(X-l-1,Y)>0) l++;
while(query(X+r+1,Y)>0) r++;
while(query(X,Y-d-1)>0) d++;
m = l+r+1; u = m-d-1;
int bx = X-l, by = Y-d;
while(query(bx-m, by-m)>0) bx-=m, by-=m;
while(query(bx, by-m)>0) by-=m;
while(query(bx-m, by)>0) bx-=m;
int ansx = bx+m*2+m/2, ansy = by+m*2+m/2;
cout << "solution " << ansx << " " << ansy << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Incorrect |
2 |
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 |
Incorrect |
1 ms |
336 KB |
Incorrect |
2 |
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 |
Runtime error |
3 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Runtime error |
4 ms |
208 KB |
Execution killed with signal 13 |
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 |
Runtime error |
4 ms |
208 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
320 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
452 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |