Submission #727946

#TimeUsernameProblemLanguageResultExecution timeMemory
727946Elvin_FritlCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; void exploreCave(int n) { int v[n]; memset(v, 0, sizeof(v)); int res[n]; for(int i=0;i<n;i++){ res[i]=i; } int z=n*2; while(z--){ int k=tryCombination(v); if(k==-1){ break; } v[k]^=1; } if(k==-1){ answer(v,res); return; } memset(v, 0, sizeof(v)); memset(res, -1, sizeof(res)); for(int i = 0; i < n; i++){ int d = tryCombination(v); if(d == -1) d = n; for (int i = 0; i < n; i++) { v[i] ^= 1; int a = tryCombination(v); if(a == -1){ d = -1; break; } if(a < d){ res[i] = a; v[i] ^= 1; } if(a > d){ res[i] = d + 1; d = a; } } if(d == n) break; } answer(v,res); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:21:8: error: 'k' was not declared in this scope
   21 |     if(k==-1){
      |        ^