제출 #110962

#제출 시각아이디문제언어결과실행 시간메모리
110962The_Wolfpack동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int ans[5006]; int tmp[5006]; int doors[5006]; void exploreCave(int N) { memset(ans,sizeof(ans),-1); for(int i=0;i<N;i++) { for(int i1=0;i1<5005;i1++) tmp[i1]=0; for(int j=0;j<N;j++) if(ans[j]!=-1) tmp[j]=ans[j]; int sta=0; if(tryCombination(tmp)==i) sta=1; int koji; int L=0; int R=N-1; while(L<=R) { int mid=(L+R)/2; for(int j=L;j<=mid;j++) tmp[j]=sta; for(int j=mid+1;j<=R;j++) tmp[j]=1-sta; for(int j=0;j<N;j++) if(ans[j]!=-1) tmp[j]=ans[j]; if(tryCombination(tmp)==i) L=mid+1; else{R=mid-1; koji=mid;} } door[koji]=i; ans[koji]=sta; } answer(ans,doors); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:30:9: error: 'door' was not declared in this scope
         door[koji]=i;  
         ^~~~
cave.cpp:30:9: note: suggested alternative: 'doors'
         door[koji]=i;  
         ^~~~
         doors