제출 #231395

#제출 시각아이디문제언어결과실행 시간메모리
231395Tehillah동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #define REP(i, a, b) for(int i=(int)(a); i<(int)(b); ++i) void exploreCave(int N) { int S[N], D[N]; for(int i=0; i<N; ++i) S[i] = 1; int ret; while(1) { ret = tryCombination(S); int end = ret; if(ret == -1) end = n; int p = end; REP(i, 0, N) { //flip ith switch S[i] = !S[i]; ret = tryCombination(S); if(ret < end) { D[i] = ret; S[i] = !S[i]; --p; } else if(ret == end) { D[i] = ret; --p; } else S[i] = !S[i]; if(p == 0) break; } if(end == n) break; } }

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:23: error: 'n' was not declared in this scope
   if(ret == -1) end = n; 
                       ^
cave.cpp:28:13: error: 'n' was not declared in this scope
   if(end == n) break;
             ^