Submission #237350

#TimeUsernameProblemLanguageResultExecution timeMemory
237350jam_xd_Cave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include "cave.h" #include "bits/stdc++.h" using namespace std; void exploreCave(int N) { int ggnomas[N]={}, S[N] = {};//inician en 0 int D[N]; for(int i=0;i<N;i++){ // crear el array del si switchs estan encendidos o apagados int prb[N]; for(int j=0;j<N;j++){ if(ggnomas[j] != 0) prb[j] = S[j]; else prb[j] = 1; } int uwu = tryCombination(prb); int afirmo = 1; if(uwu<=i and uwu!=-1) afirmo = 0; // Posicion del switch q quiero int minimo=0, maximo=n-1; int medio; //binary search del stack adaptado xd xd while(minimo <= maximo){ medio = (minimo + maximo)/2; for(int j=0;j <= medio;i++){ if(ggnomas[j] != 0) prb[j] = S[j]; else prb[j] = afirmo; } for(int k= medio+1;k< N;j++){ if(ggnomas[k] != 0) prb[k] = S[k]; else prb[k] = 1 - afirmo; } uwu = tryCombination(prb); if(uwu > i or uwu== -1){ maximo = medio-1; } else { medio++; minimo = medio; } } ggnomas[medio] = 1; S[medio] = afirmo; D[medio] = i; } answer(S,D); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:24:24: error: 'n' was not declared in this scope
   int minimo=0, maximo=n-1;
                        ^
cave.cpp:34:28: error: 'j' was not declared in this scope
    for(int k= medio+1;k< N;j++){
                            ^