제출 #1289932

#제출 시각아이디문제언어결과실행 시간메모리
1289932muhammad-ahmad동굴 (IOI13_cave)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; void exploreCave(int N) { int x, st[N], D[N], Q[N]; for (int i = 0; i < N; i++) st[i] = D[i] = -1; for (int i = 0; i < N; i++){ int cur = 0; for (int j = 0; j < N; j++){ if (st[j] != -1) Q[j] = 0; else Q[j] = st[j]; } x = tryCombination(Q); if (x > i or x == -1) cur = 1; int l = 0, r = N; while (r - l > 1){ int m = (l + r) / 2; for (int j = 0; j < n; j++){ if (st[j] != -1) Q[j] = st[j]; else if (j >= l && j <= m) Q[j] = cur; else Q[j] = !cur; } x = tryCombination(Q); if (x > i or x == -1) r = m; else l = m; } st[l] = cur; D[l] = i; } answer(st, D); } // int main(){ // exploreCave(2); // }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:19:45: error: 'n' was not declared in this scope
   19 |                         for (int j = 0; j < n; j++){
      |                                             ^