답안 #642256

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
642256 2022-09-19T04:48:29 Z christinelynn Aliens (IOI07_aliens) C++17
0 / 100
3 ms 320 KB
#include <bits/stdc++.h>
using namespace std;

#define nyahalo ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define otsumiko exit(0);
#define mikodanye priority_queue<pair<long long, long long>, vector<pair<long long, long long> >, greater<pair<long long, long long> > >
#define mikochi priority_queue<long long, vector<long long>, greater<long long> >

long long n, m, ux, uy, bx, by, x, y, mx, my, xc, yc, ci, cj, nl, nr, nu, nb, dx, dy;
string qs = "examine", rp, so = "solution";

bool qr(long long cx, long long cy) {
  if (cx>n || cx<1 || cy>n || cy<1) {
    return 0;
  }
  cout << qs << " " << cx << " " << cy << "\n" << flush;
  cin >> rp;
  if (rp[0] == 't') {
    return 1;
  }
  return 0;
}

int main() {
  nyahalo
  long long i, j, x0, y0;
  cin >> n >> x0 >> y0;
  ux = x0;
  uy = y0;
  x = x0-1;
  y = y0-1;
  m = 1;
  while (qr(x, y)) {
    m++;
    ux = x;
    uy = y;
    x--;
    y--; 
  }
  bx = x0;
  by = y0;
  x = x0+1;
  y = y0+1;
  while (qr(x, y)) {
    m++;
    bx = x;
    by = y;
    x++;
    y++;
  }
  ux += m-1;
  bx -= m-1;
  x = ux+1;
  y = uy-1;
  while (qr(x, y)) {
    m++;
    ux = x;
    uy = y;
    x++;
    y--;
  }
  x = bx-1;
  y = by+1;
  while (qr(x, y)) {
    m++;
    bx = x;
    by = y;
    x--;
    y++;
  }
  mx = (bx+ux)/2;
  my = (by+uy)/2;
  x = mx-2*m;
  y = my;
  nl = 0;
  while (qr(x, y)) {
    nl++;
    x -= 2*m;
  }
  nr = 0;
  x = mx+2*m;
  y = my;
  while (qr(x, y)) {
    nr++;
    x += 2*m;
  }
  if (nl == 0) {
    if (nr == 2) {
      cj = 1;
    } else {
      cj = 2;
    }
  }
  if (nl == 1) {
    if (nr == 1) {
      cj = 3;
    } else {
      cj = 4;
    }
  } 
  if (nl == 2) {
    cj = 5;
  }
  nu = 0;
  nb = 0;
  x = mx;
  y = my+2*m;
  while (qr(x, y)) {
    nu++;
    y += 2*m;
  }
  x = mx;
  y = my-2*m;
  while (qr(x, y)) {
    nb++;
    y -= 2*m;
  }
  if (nu == 0) {
    if (nb == 2) {
      ci = 1;
    } else {
      ci = 2;
    }
  }
  if (nu == 1) {
    if (nb == 1) {
      ci = 3;
    } else {
      ci = 4;
    }
  }
  if (nu == 2) {
    ci = 5;
  }
  ci = 5-ci+1;
  dx = 3-cj;
  dy = 3-ci;
  xc = mx+dx*m;
  yc = my+dy*m;
  //cout << "ci: " << ci << " cj: " << cj << "\n";
  cout << so << " " << xc << " " << yc << "\n" << flush;
  otsumiko
}

Compilation message

aliens.cpp: In function 'int main()':
aliens.cpp:26:13: warning: unused variable 'i' [-Wunused-variable]
   26 |   long long i, j, x0, y0;
      |             ^
aliens.cpp:26:16: warning: unused variable 'j' [-Wunused-variable]
   26 |   long long i, j, x0, y0;
      |                ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 320 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 208 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -