제출 #647494

#제출 시각아이디문제언어결과실행 시간메모리
647494tigar동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> void exploreCave(int N) { int combos[2][N]; int door[N]; bool check[N]; for(int i=0; i<N; i++){combos[0][i]=0; combos[1][i]=1; check[i]=false;} for(int i=0; i<N; i++) { int bol=1; int xx=tryCombination(combos[0]); if(xx>i or xx==-1)bol=0; int l=0, r=N, midd=N/2; while(l<=r) { for(int j=0; i<N; j++) { if((j>=midd or j<l) and !check[j])combos[bol][j]=abs(bol-1); else if((j<midd and j>=l) and !check[j])combos[bol][j]=bol; } int br=tryCombination(combos[bol]) if(l==r){check[l]=true; combos[0][l]=bol; combos[1][l]=bol; door[l]=i;} else if(br>i or br==-1){r=midd-1; midd=(l+r)/2;} else {l=midd+1; midd=(l+r)/2;} } } return answer(combos[0], door); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:24:13: error: expected ',' or ';' before 'if'
   24 |             if(l==r){check[l]=true; combos[0][l]=bol; combos[1][l]=bol; door[l]=i;}
      |             ^~
cave.cpp:25:13: error: 'else' without a previous 'if'
   25 |             else if(br>i or br==-1){r=midd-1; midd=(l+r)/2;}
      |             ^~~~