Submission #237348

#TimeUsernameProblemLanguageResultExecution timeMemory
237348jam_xd_동굴 (IOI13_cave)C++17
Compilation error
0 ms0 KiB

#include "cave.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:11:16: error: 'n' was not declared in this scope
  for(int i=0;i<n;i++){
                ^
cave.cpp:14:16: error: expected ';' before '<' token
   for(int j=0,j<N;j++){
                ^
cave.cpp:14:16: error: expected primary-expression before '<' token
cave.cpp:33:28: error: 'j' was not declared in this scope
    for(int k= medio+1;k< N;j++){
                            ^