제출 #81336

#제출 시각아이디문제언어결과실행 시간메모리
81336anaonoprishvili동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #include<bits/stdc++.h> int ans[50005],ans1[50005],s[50005],fix[50005]; void exploreCave(int N) { for(int i=0; i<N; i++) { for(int j=0;j<N;j++) if(fix[j]==1) s[j]=ans[j]; else s[j]=0; int x=tryCombination(s); int k=0; if(x==-1 || x>i) k=1; int t=k, l=0, r=N-1, p=0; while(l<=r) { int m=(L+r)/2; for(int j=l;j<=m;j++) if(fix[j]==0) s[j]=1-s[j]; x=tryCombination(s); int c=0; if(x==-1 || x>i) c=1; if(k!=w) r=m-1, p=m; else l=m+1; k=c; } ans1[p]=i; fix[p]=1; if (t==1) ans[p]=0; else ans[p]=1; } answer(ans,ans1); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:11: error: 'L' was not declared in this scope
    int m=(L+r)/2;
           ^
cave.cpp:21:10: error: 'w' was not declared in this scope
    if(k!=w) r=m-1, p=m;
          ^