Submission #393229

#TimeUsernameProblemLanguageResultExecution timeMemory
393229GammaCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
//#include "cave.h" #include "bits/stdc++.h" using namespace std; void exploreCave(int N) { int y, a[N], d[N], s[N]; memset(d, -1, sizeof d); for(int i = 0; i < N; i++) { // memset(a, 0, sizeof a); for(int j = 0; j < N; j++) { if(j < i) a[j] = s[d[j]]; else a[j] = 0; } y = tryCombination(a); if(y < i && y != -1) { int S = i, e = N - 1, mid; while(S <= e) { mid = (S + e) / 2; for(int j = S; j < mid; j++) { a[j] = 1; } y = tryCombination(a); if(y < i && y != -1) { a[mid] = 1; y = tryCombination(a); if(y < i && y != -1) { S = mid + 1; } else { d[i] = mid; s[mid] = 1; break; } } else { e = mid - 1; for(int j = S; j < mid; j++) { a[j] = 0; } } } }else { int S = i, e = N - 1, mid; while(S <= e) { mid = (S + e) / 2; for(int j = S; j < mid; j++) { a[j] = 1; } y = tryCombination(a); if(y < i && y != -1) { e = mid - 1; for(int j = S; j < mid; j++) { a[j] = 0; } } else { a[mid] = 1; y = tryCombination(a); if(y < i && y != -1) { d[i] = mid; s[mid] = 1; break; } else { S = mid + 1; } } } } } answer(s, d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:19:13: error: 'tryCombination' was not declared in this scope
   19 |         y = tryCombination(a);
      |             ^~~~~~~~~~~~~~
cave.cpp:94:5: error: 'answer' was not declared in this scope
   94 |     answer(s, d);
      |     ^~~~~~