Submission #920212

# Submission time Handle Problem Language Result Execution time Memory
920212 2024-02-02T09:32:55 Z LucaLucaM Aliens (IOI07_aliens) C++17
Compilation error
0 ms 0 KB
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <cstring>
#warning That's the baby, that's not my baby

typedef long long ll;

bool is_local = LOCAL;
int localN = 19, localM = 3;
int x1 = 4, y1 = 5, x2 = 18, y2 = 19;

bool answerLocal(int x, int y) {
  return (x1 <= x && x <= x2 && y1 <= y && y <= y2);
}

bool ask(int x, int y) {
  std::cout << "examine " << x << ' ' << y << std::endl;
  if (is_local) {
    return answerLocal(x, y);
  }
  std::string s;
  std::cin >> s;
  return (s == "true"? 1 : 0);
}

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);

  int n, x0, y0;
  std::cin >> n >> x0 >> y0;

  int l = 1, r = x0;
  while (l < r) {
    int mid = (l + r) / 2;
    if (ask(mid, y0)) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }

  int x1 = r;

  l = x0, r = n;
  while (l < r) {
    int mid = (l + r + 1) / 2;
    if (ask(mid, y0)) {
      l = mid;
    } else {
      r = mid - 1;
    }
  }

  int x2 = r;

  int m = x2 - x1 + 1;

  l = 1, r = y0;
  while (l < r) {
    int mid = (l + r) / 2;
    if (ask(x0, mid)) {
      r = mid;
    } else {
      l = mid + 1;
    }
  }

  int y1 = r;
  int y2 = y1 + m - 1;

  std::cout << "solution " << (x1 + x2) / 2 << ' ' << (y1 + y2) / 2;

  return 0;
}

Compilation message

aliens.cpp:6:2: warning: #warning That's the baby, that's not my baby [-Wcpp]
    6 | #warning That's the baby, that's not my baby
      |  ^~~~~~~
aliens.cpp:10:17: error: 'LOCAL' was not declared in this scope
   10 | bool is_local = LOCAL;
      |                 ^~~~~