Submission #231415

#TimeUsernameProblemLanguageResultExecution timeMemory
231415TehillahCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" void exploreCave(int N) { int S[N], D[N]; for(int i=0; i<N; ++i) S[i] = 1; int ret, lst = 0; while(1) { ret = tryCombination(S); int end = ret; if(ret == -1) end = n; int p = end; REP(i, lst, N) { //flip ith switch S[i] = !S[i]; ret = tryCombination(S); if(ret < end) { D[i] = ret; S[i] = !S[i]; --p; } else if(ret == end) { D[i] = ret; --p; } else S[i] = !S[i]; if(p == 0) break; } lst = end; if(end == n) break; } }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:10:23: error: 'n' was not declared in this scope
   if(ret == -1) end = n; 
                       ^
cave.cpp:12:7: error: 'i' was not declared in this scope
   REP(i, lst, N) {
       ^
cave.cpp:12:3: error: 'REP' was not declared in this scope
   REP(i, lst, N) {
   ^~~
cave.cpp:28:13: error: 'n' was not declared in this scope
   if(end == n) break;
             ^
cave.cpp:11:7: warning: unused variable 'p' [-Wunused-variable]
   int p = end;
       ^
cave.cpp:4:12: warning: unused variable 'D' [-Wunused-variable]
  int S[N], D[N];
            ^