Submission #1106386

#TimeUsernameProblemLanguageResultExecution timeMemory
1106386NonbangkokCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "cave.h" void exploreCave(int N) { int S[N], D[N], last=-2, start=0, closed_door; for(int i=0;i<N;i++)S[i]=D[i]=0; while(start!=N){ for(int i=start;i<N;i++){ int closed_door = tryCombination(S); if(closed_door != last){ D[last] = i; start++; i = start; last = closed_door; continue; } S[i] = 1; int closed_door = tryCombination(S); if(closed_door != last){ D[last] = i; start++; i = start; last = closed_door; continue; } S[i] = 0; } } answer(S,D); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:19:17: error: redeclaration of 'int closed_door'
   19 |             int closed_door = tryCombination(S);
      |                 ^~~~~~~~~~~
cave.cpp:10:17: note: 'int closed_door' previously declared here
   10 |             int closed_door = tryCombination(S);
      |                 ^~~~~~~~~~~
cave.cpp:5:39: warning: unused variable 'closed_door' [-Wunused-variable]
    5 |     int S[N], D[N], last=-2, start=0, closed_door;
      |                                       ^~~~~~~~~~~