제출 #647935

#제출 시각아이디문제언어결과실행 시간메모리
647935TrashCoder007동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; void exploreCave(int n) { int a[n]; int id [n]; for (int i = 0; i < n; i++) id[i] = -1; for (int i = 0; i < n; i++){ int val = tryCombination(a); int k = 0; //abierta con 0 if (val == i) k = 1; //abierta con 1 int ini = 0, fin = n; while(ini < fin){ int pos [n]; int m = (ini + fin) / 2; for (int j = 0; j < n; j++){ if (j >= ini && j <= m && id[j] == -1){ pos[j] = 1 - k; }else if (id[j] != -1){ pos[j] = a[j]; }else{ pos[j] = k; } } int res = tryCombination(pos); if ((res == ini && k) || (res != ini && !k)){ ini = m + 1; }else{ fin = m; } } id[ini - 1] = i; a[ini - 1] = k; } answer(a, id); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:12:19: error: 'tryCombination' was not declared in this scope
   12 |         int val = tryCombination(a);
      |                   ^~~~~~~~~~~~~~
cave.cpp:41:5: error: 'answer' was not declared in this scope
   41 |     answer(a, id);
      |     ^~~~~~