Submission #52134

#TimeUsernameProblemLanguageResultExecution timeMemory
52134rondojimCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
//#include "cave.h" const int MAXN = 5e3 + 5; int bit[MAXN], door[MAXN], vis[MAXN]; void exploreCave(int n){ for(int i=0; i<n; ++i){ int ret = tryCombination(bit), lo = 0, hi = n - 1, mid, pos; while(lo < hi){ mid = (lo + hi)>>1; for(int j=lo; j<=mid; ++j) if(!vis[j]) bit[j] ^= 1; pos = ret; ret = tryCombination(st); if(pos == i || ret == i) hi = mid; else lo = mid + 1; } if(ret == i) bit[lo] ^= 1; door[lo] = i, vis[lo] = 1; } answer(bit, door); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:9:15: error: 'tryCombination' was not declared in this scope
     int ret = tryCombination(bit), lo = 0, hi = n - 1, mid, pos;
               ^~~~~~~~~~~~~~
cave.cpp:10:11: error: 'lo' was not declared in this scope
     while(lo < hi){
           ^~
cave.cpp:10:16: error: 'hi' was not declared in this scope
     while(lo < hi){
                ^~
cave.cpp:10:16: note: suggested alternative: 'i'
     while(lo < hi){
                ^~
                i
cave.cpp:11:7: error: 'mid' was not declared in this scope
       mid = (lo + hi)>>1;
       ^~~
cave.cpp:13:7: error: 'pos' was not declared in this scope
       pos = ret;
       ^~~
cave.cpp:14:28: error: 'st' was not declared in this scope
       ret = tryCombination(st);
                            ^~
cave.cpp:18:22: error: 'lo' was not declared in this scope
     if(ret == i) bit[lo] ^= 1;
                      ^~
cave.cpp:19:10: error: 'lo' was not declared in this scope
     door[lo] = i, vis[lo] = 1;
          ^~
cave.cpp:21:3: error: 'answer' was not declared in this scope
   answer(bit, door);
   ^~~~~~