제출 #856514

#제출 시각아이디문제언어결과실행 시간메모리
856514IS_Rushdi동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> // #include "cave.h" using namespace std; void exploreCave(int n) { int a[n],b[n]; for(int i = 0; i < n; i++){ a[i] = -1; b[i] = -1; } for(int i = 0; i < n; i++){ int num = 0; for(int j = 0; j < n; j++){ if(b[j] == -1) a[i] = 0; } int ask = tryCombination(a); if(ask <= i) num = 1; int l = 1,r=n-i; int idx = -1; while(l <= r){ int m = (l+r)/2; int cnt = 0; for(int j = 0; j < n; j++){ if(cnt >= m){ if(b[j] == -1){ a[j] = 1-num; } }else{ if(b[j] == -1){ a[j] = num; idx = j; cnt++; } } } ask = tryCombination(a); if(ask <= i) l = m+1; else{r = m-1;} } a[idx] = num; b[idx] = i; } answer(a,b); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:18:19: error: 'tryCombination' was not declared in this scope
   18 |         int ask = tryCombination(a);
      |                   ^~~~~~~~~~~~~~
cave.cpp:45:5: error: 'answer' was not declared in this scope
   45 |     answer(a,b);
      |     ^~~~~~