Submission #584487

# Submission time Handle Problem Language Result Execution time Memory
584487 2022-06-27T13:03:17 Z Dan4Life Aliens (IOI07_aliens) C++17
0 / 100
3 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 -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()
{
    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 1 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# 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 2 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 Runtime error 1 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 312 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 3 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 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 316 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -