제출 #346645

#제출 시각아이디문제언어결과실행 시간메모리
346645Pety동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "cave.h"

using namespace std;

const int N = 5000;

bool found[N + 2];
int Switch[N + 2], query[N + 2], s[N + 2], d[N + 2];

//int tryCombination (int s[]);

int ask (int n, int mij, int state) {
   for (int i = 0; i < n; i++)
    if (found[i])
      query[i] = Switch[i];
    else if (i <= mij)
      query[i] = state;
    else
      query[i] = 1 - state;
  return tryCombination(query);
}

void explore (int n) {
  for (int i = 0; i < n; i++) {
    bool state;
    if (ask(n, n - 1, 1) > i)
      state = 1;
    else
      state = 0;
    int st = 0, dr = n - 1, poz = 0;
    while (st <= dr) {
      int mij = (st + dr) / 2;
      int aux = ask(n, mij, state);
      if (aux > i || aux == -1) {
        dr = mij - 1;
        poz = mij;
      }
      else
        st = mij + 1;
    }
    d[poz] = i;
    s[poz] = state;
    found[poz] = 1;
    Switch[poz] = state;
  }
  answer(s, d);
}

컴파일 시 표준 에러 (stderr) 메시지

/tmp/cc1xk2OH.o: In function `main':
grader.c:(.text.startup+0xc): undefined reference to `exploreCave'
collect2: error: ld returned 1 exit status