Submission #485349

#TimeUsernameProblemLanguageResultExecution timeMemory
485349silverfishCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int s[5005], curs[5005], door[5005]; int getstate(int comb, int i){ return (comb > i || comb==-1); } void setcurs(int b, int f, int val){ for(int i = b; i < f; ++i){ if(~s[k]) curs[k] = s[k]; else curs[k] = val; } } void exploreCave(int N) { fill(s, s+N, -1); for(int i = 0; i < N; ++i){ setcurs(0, N, 0); int d = 0, state = getstate(tryCombinations(curs), i); for(int j = 12; j >= 0; --j){ setcurs(d, min(d + (1<<j), N), 1); if(getstate(tryCombination(curs), i) == state) d = min(d + (1<<j), N-1); else setcurs(d, min(d + (1<<j), N), 0); } door[d] = i; s[d] = (state ? 0 : 1); } answer(s, door); }

Compilation message (stderr)

cave.cpp: In function 'void setcurs(int, int, int)':
cave.cpp:12:9: error: 'k' was not declared in this scope
   12 |   if(~s[k]) curs[k] = s[k];
      |         ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:22:31: error: 'tryCombinations' was not declared in this scope; did you mean 'tryCombination'?
   22 |   int d = 0, state = getstate(tryCombinations(curs), i);
      |                               ^~~~~~~~~~~~~~~
      |                               tryCombination