Submission #500621

# Submission time Handle Problem Language Result Execution time Memory
500621 2021-12-31T15:34:58 Z 600Mihnea Aliens (IOI07_aliens) C++17
80 / 100
4 ms 456 KB
#include <bits/stdc++.h>

using namespace std;

#define int long long

int dr[] = {-1, 0, 1, 0};
int dc[] = {0, 1, 0, -1};

vector<pair<int, int>> guys;


signed main() {
  int n, r0, c0;
  cin >> n >> r0 >> c0;

  function<bool(int, int)> is = [&] (int r, int c) {
    if (1 <= r && 1 <= c && r <= n && c <= n) {
      cout << "examine " << r << " " << c << endl;
      string s;
      cin >> s;
      assert(s == "true" || s == "false");
      return (s == "true");
    }
    return false;
  };

  for (int k = 0; k < 4; k++) {
    int r = r0, c = c0;
    while (1) {
      pair<int, int> init = {r, c};

      for (int step = 1 << 30; step; step /= 2) {
        if (is(r + dr[k] * step, c + dc[k] * step)) {
          r += dr[k] * step;
          c += dc[k] * step;
        }
      }

      pair<int, int> fini = {r, c};

      if (init == fini) {
        break;
      }
    }
    guys.push_back({r, c});
  }

  cout << "solution ";
  cout << (guys[0].first + guys[2].first) / 2 << " ";
  cout << (guys[1].second + guys[3].second) / 2 << endl;


  return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 4 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB Output is correct
2 Correct 3 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 2 ms 280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Runtime error 4 ms 456 KB Execution killed with signal 6
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 3 ms 200 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 3 ms 200 KB Output is correct
3 Correct 4 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 200 KB Output is correct
2 Correct 3 ms 200 KB Output is correct
3 Runtime error 4 ms 328 KB Execution killed with signal 6
# Verdict Execution time Memory Grader output
1 Correct 4 ms 200 KB Output is correct
2 Correct 3 ms 200 KB Output is correct
3 Correct 3 ms 200 KB Output is correct