제출 #59272

#제출 시각아이디문제언어결과실행 시간메모리
59272muradeyn동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> #define SIZE 5001 using namespace std; int connect[SIZE]; bool fxd[SIZE]; int comb[SIZE]; void b_search(int i,int l,int r) { int curr = tryCombination(comb) , nxt; if (curr != -1 && curr < i) curr = 0; else curr = 1; if (l == r) { D[l] = i; if (curr == 0)S[l] = 1 - comb[l]; else S[l] = comb[l]; fxd[l] = true; return; } int m = (l + r) >> 1; for (int i = l;i<=m;i++) if (fxd[i] == false) comb[i] = 1 - comb[i]; nxt = tryCombination(comb); if (nxt != -1 && nxt < i) nxt = 0; else nxt = 1; if (nxt != curr) b_search(i,l,m); else b_search(i,m + 1,r); } void exploreCave() { for (int i = 0;i<n;i++) { for (int j = 0;j<n;j++) if (fxd[j] == false)comb[j] = 1; b_search(i,0,n - 1); } }

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

cave.cpp: In function 'void b_search(int, int, int)':
cave.cpp:17:9: error: 'D' was not declared in this scope
         D[l] = i;
         ^
cave.cpp:18:23: error: 'S' was not declared in this scope
         if (curr == 0)S[l] = 1 - comb[l];
                       ^
cave.cpp:19:14: error: 'S' was not declared in this scope
         else S[l] = comb[l];
              ^
cave.cpp: In function 'void exploreCave()':
cave.cpp:35:22: error: 'n' was not declared in this scope
     for (int i = 0;i<n;i++) {
                      ^