제출 #551496

#제출 시각아이디문제언어결과실행 시간메모리
551496beedle동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <set> #include <iterator> #include <stack> #include <map> #include <math.h> #include <bitset> #include <deque> #include <string> #include <tuple> #include <queue> #include <numeric> #include <unordered_set> #include <unordered_map> #define pi 3.141592653589793238 #define ll long long #define ld long double #define rep(i, a, b) for (long long i = a; i <= b; i++) #define mod 998244353ll #define INF 1000000000000000000 #define pb push_back #define ff first #define ss second #define endl '\n' #define all(x) (x).begin (), (x).end () #define sz(x) (ll) (x).size () #define reunique(v) v.resize(std::unique(v.begin(), v.end()) - v.begin()) #define rank rnk #define log lg #define fast \ ios_base::sync_with_stdio (false); \ cin.tie (NULL); \ cout.tie (NULL) // #include "cave.h" using namespace std; // int tryCombination(int s[]) // void answer(int s[], int d[]) void exploreCave(int n) { bool known[n]; rep(i,0,n-1) known[i]=false; int actual[n]; int binding[n]; vector <int> idx; rep(i,0,n-1) idx.pb(i); rep(door,0,n-1) { int q[n]; for(auto x:idx) q[x]=0; rep(i,0,n-1) if(known[i]) q[i]=actual[i]; int ans=tryCombination(q); int expected; if(ans==-1 || ans>door) expected=0; else expected=1; int lo=0; int hi=sz(idx); while(hi-lo!=0) { int mid=(lo+hi)/2; rep(i,0,n-1) if(known[i]) q[i]=actual[i]; rep(i,lo,mid) q[idx[i]]=expected; rep(i,mid+1,hi) q[idx[i]]=1^expected; ans=tryCombination(q); if(ans==-1 || ans>door) { hi=mid; } else { lo=mid+1; } } known[hi]=true; binding[hi]=door; actual[hi]=expected; vector <int> nidx; for(auto x:idx) if(x!=hi) nidx.pb(x); idx=nidx; } answer(actual,binding); } // signed main() // { // fast; // // freopen("milkorder.in","r",stdin); // // freopen("milkorder.out","w",stdout); // return 0; // }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:66:17: error: 'tryCombination' was not declared in this scope
   66 |         int ans=tryCombination(q);
      |                 ^~~~~~~~~~~~~~
cave.cpp:113:5: error: 'answer' was not declared in this scope
  113 |     answer(actual,binding);
      |     ^~~~~~