제출 #1298436

#제출 시각아이디문제언어결과실행 시간메모리
1298436gesp3011v2동굴 (IOI13_cave)C++20
컴파일 에러
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; void exploreCave(int N){ int a[N]; memset(a,0,sizeof a); int b[n]; for(int i=0;i<n;i++){ int x=tryCombination(a); if(x==-1)break; for(int j=0;j<n;j++){ if(a[j]==1)continue; a[j]=1; int y=tryCombination(a); a[j]=0; if(y>x || y==-1){ a[j]=1; break; } } } //int z=tryCombination(a); for(int i=0;i<n;i++){ a[i]=abs(a[i]-1); int x=tryCombination(a); a[i]=abs(a[i]-1); b[i]=x; } answer(a,b); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:8:7: error: 'n' was not declared in this scope
    8 | int b[n];
      |       ^
cave.cpp:28:5: error: 'b' was not declared in this scope
   28 |     b[i]=x;
      |     ^
cave.cpp:30:10: error: 'b' was not declared in this scope
   30 | answer(a,b);
      |          ^