제출 #653902

#제출 시각아이디문제언어결과실행 시간메모리
653902AbdelmagedNour동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") using namespace std; const int N=5005; int s[N],d[N],done[N],now; bool check(int md){ for(int i=0;i<=md;i++)s[i]^=(!done[i]); int x=tryCombination(s); for(int i=0;i<=md;i++)s[i]^=(!done[i]); return x>now||x==-1; } void exploreCave(int n){ for(int i=0;i<n;i++){ now=i; int x=tryCombination(s); for(int j=0;j<n&&(x>i||x==-1);j++)s[j]^=(!done[j]); int l=0,r=n-1,ans; while(l<=r){ int md=(l+r)>>1; if(check(md))r=(ans=md)-1; else l=md+1; } d[ans]=i; done[ans]=1; s[ans]^=1; } answer(s,d); }

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

cave.cpp: In function 'bool check(int)':
cave.cpp:8:11: error: 'tryCombination' was not declared in this scope
    8 |     int x=tryCombination(s);
      |           ^~~~~~~~~~~~~~
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:15: error: 'tryCombination' was not declared in this scope
   15 |         int x=tryCombination(s);
      |               ^~~~~~~~~~~~~~
cave.cpp:27:5: error: 'answer' was not declared in this scope
   27 |     answer(s,d);
      |     ^~~~~~