Submission #584494

# Submission time Handle Problem Language Result Execution time Memory
584494 2022-06-27T13:08:51 Z Dan4Life Aliens (IOI07_aliens) C++17
40 / 100
5 ms 320 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 0;
    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()
{
    cin >> n >> X >> Y; M[{X,Y}]=1;
    while(query(X-l-1,Y)) l++;
    while(query(X+r+1,Y)) r++;
    while(query(X,Y-d-1)) d++;
    m = l+r+1; u = m-d-1;
    int bx = X-l, by = Y-d;
    while(query(bx-m, by-m)) bx-=m, by-=m;
    while(query(bx, by-2*m)) by-=2*m;
    while(query(bx-2*m, by)) bx-=2*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 Correct 0 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 2 ms 296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 208 KB Output is correct
2 Correct 2 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 208 KB Output is correct
2 Correct 2 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 320 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 3 ms 208 KB Execution killed with signal 13
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 208 KB Output is correct
2 Runtime error 2 ms 208 KB Execution killed with signal 13
3 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 Runtime error 5 ms 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 316 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -