Submission #870493

#TimeUsernameProblemLanguageResultExecution timeMemory
870493AtabayRajabliCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include "cave.h" void exploreCave(int n) { int a[n], b[n], used[n], d[n]; for(int i = 0; i<n; i++) { a[i] = 0; b[i] = 0; used[n] = 0; } int l, r, mid; for(int i = 0; i<n; i++) { for(int i = 0; i<n; i++)if(!used[i])b[i] = 0; l = 0, r = n-1; int q = tryCombination(b), open; if(q == -1)q = n; while(l < r) { mid = (l + r) / 2; for(int i = 0; i<n; i++) { if(used[i])continue; if(l <= i && i <= mid) b[i] ^= 1; } int k = tryCombination(b); if(k == -1)k = n; if((q == i && k > i) || (q > i && k == i))l = mid + 1; else r = mid; for(int i = 0; i<n; i++)if(!used[i])b[i] = 0; } d[i] = l; c[l] = 1; if(q > i)a[i] = a[i]; else a[i] = !a[i]; b[l] = a[i]; used[l] = 1; } answer(a, d); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:40:9: error: 'c' was not declared in this scope
   40 |         c[l] = 1;
      |         ^
cave.cpp:18:36: warning: unused variable 'open' [-Wunused-variable]
   18 |         int q = tryCombination(b), open;
      |                                    ^~~~