제출 #55670

#제출 시각아이디문제언어결과실행 시간메모리
55670leejseo동굴 (IOI13_cave)C++98
컴파일 에러
0 ms0 KiB
#include "cave.h" #include <vector> using namespace std; vector<int> L; int S[5001], D[5001]; bool DONE[5001]; int binary(int s, int e, int i, int prev){ if (s == e) return s; int mid = (s+e) >> 1; for (int i=s; i<=mid; i++) S[L[i]] ^= 1; int res = tryCombination(S); if ((res == i) == (prev == i)) return binary(mid+1, e, i, res); return binary(s, mid, i, res); } void exploreCave(int N) { //what is cooected to 0? for (int i=0; i<N; i++){ L.clear(); for (int j=0; j<N; j++){ if (!DONE[j]) L.push_back(j); } int m = j.size(); for (int j=0; j<m; j++) S[L[j]] = 0; int prev = tryCombination(S); int res = L[binary(s, e, i, prev)]; D[res] = i; if (tryCombination(S) > i) S[res] ^= 1; DONE[res] = 1; } }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:27:11: error: 'j' was not declared in this scope
   int m = j.size();
           ^
cave.cpp:30:22: error: 's' was not declared in this scope
   int res = L[binary(s, e, i, prev)];
                      ^
cave.cpp:30:25: error: 'e' was not declared in this scope
   int res = L[binary(s, e, i, prev)];
                         ^