제출 #855713

#제출 시각아이디문제언어결과실행 시간메모리
855713_uros9동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define endl '\n' using namespace std; const int MAXN=5009; int g_d[MAXN],i_odkljucava[MAXN]={0},probaj[MAXN],vrata_br[MAXN]; bool checked[MAXN]={0}; int n; void kojeg_odkljucava(int br,int l,int d){ if(l==d){ i_odkljucava[l]=br; g_d[l]=vrata_br[br]; checked[l]=true; return; } int s=(l+d)/2; for(int i=0; i<n; i++){ if(checked[i]){ probaj[i]=g_d[i]; continue; } probaj[i]=1-vrata_br[br]; } for(int i=l; i<=s; i++){ if(checked[i]){ probaj[i]=g_d[i]; continue; } probaj[i]=vrata_br[br]; } int ans=tryCombination(probaj); if(ans==-1||ans>=br) kojeg_odkljucava(br,l,s); else kojeg_odkljucava(br,s+1,d); } void resavaj_za(int br){ for(int i=0; i<n; i++){ if(checked[i]){ probaj[i]=g_d[i]; continue; } probaj[i]=0; } int ans=tryCombination(probaj); if(ans==-1||ans>=br) vrata_br[br]=0; else vrata_br[br]=1; } void exploreCave(int N) { n=N; for(int i=0; i<n; i++){ resavaj_za(i); } answer(g_d,i_odkljucava); }

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

cave.cpp: In function 'void kojeg_odkljucava(int, int, int)':
cave.cpp:31:13: error: 'tryCombination' was not declared in this scope
   31 |     int ans=tryCombination(probaj);
      |             ^~~~~~~~~~~~~~
cave.cpp: In function 'void resavaj_za(int)':
cave.cpp:46:13: error: 'tryCombination' was not declared in this scope
   46 |     int ans=tryCombination(probaj);
      |             ^~~~~~~~~~~~~~
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:59:5: error: 'answer' was not declared in this scope
   59 |     answer(g_d,i_odkljucava);
      |     ^~~~~~