제출 #372398

#제출 시각아이디문제언어결과실행 시간메모리
372398amano_hina동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" void exploreCave(int n) { int a[n],b[n],f[n],mid,ans,ans2,have[n],l,r; for(int i=0;i<n;i++) { f[i]=i; a[i]=0; } for(int i=0;i<n;i++) { ans=tryCombination(a); l=0; r=n-1-i; while(l<r) { mid=(l+r)/2; for(int j=l;j<=m;j++) { a[f[j]]=1-a[f[j]]; } ans2=tryCombination(a); if(ans==ans2) { l=m+1; } else { r=m; } ans=ans2; } if(ans!=i) { a[l]=1-a[l]; b[l]=i; } for(int j=l;j<n-1-i;j++) { f[j]=f[j+1]; } } answer(a,b); /* ... */ }

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

cave.cpp:47:16: error: stray '\315' in program
   47 |     answer(a,b);
      |                ^
cave.cpp:47:17: error: stray '\276' in program
   47 |     answer(a,b);
      |                 ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:19:28: error: 'm' was not declared in this scope
   19 |             for(int j=l;j<=m;j++)
      |                            ^
cave.cpp:26:19: error: 'm' was not declared in this scope
   26 |                 l=m+1;
      |                   ^
cave.cpp:30:19: error: 'm' was not declared in this scope
   30 |                 r=m;
      |                   ^
cave.cpp:47:16: error: expected ';' before '}' token
   47 |     answer(a,b);
      |                ^
      |                ;
......
   50 | }
      | ~               
cave.cpp:4:37: warning: unused variable 'have' [-Wunused-variable]
    4 |     int a[n],b[n],f[n],mid,ans,ans2,have[n],l,r;
      |                                     ^~~~