제출 #530068

#제출 시각아이디문제언어결과실행 시간메모리
530068buidangnguyen05동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
/* input */ //#include "cave.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 5e3; int n, done[N], state[N], que[N]; int query(int R) { for (int i = 0; i < n; ++i) { if (done[i] != -1) que[i] = state[i]; else que[i] = (i <= R); } return tryCombination(que); } void exploreCave(int _n) { memset(done, -1, sizeof(done)); n = _n; int prev = query(0); for (int i = 0; i < n; ++i) { int L = -1, R = n - 1, pos = 0; while (L <= R) { int mid = (L + R) >> 1; int cur = query(mid); if ((prev == i && cur != i) || (prev != i && cur == i)) { pos = mid; R = mid - 1; } else L = mid + 1; } if (prev == i) state[pos] = 1; done[pos] = i; prev = query(0); } answer(state, done); }

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

cave.cpp: In function 'int query(int)':
cave.cpp:18:9: error: 'tryCombination' was not declared in this scope
   18 |  return tryCombination(que);
      |         ^~~~~~~~~~~~~~
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:40:2: error: 'answer' was not declared in this scope
   40 |  answer(state, done);
      |  ^~~~~~