제출 #448278

#제출 시각아이디문제언어결과실행 시간메모리
448278M_W동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; int a[5050], pos[5050]; bool mark[5050]; void exploreCave(int N){ for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ if(!mark[j]) a[j] = 0; } int zero = tryCombination(a); for(int j = 0; j < N; j++){ if(!mark[j]) a[j] = 1; } int one = tryCombination(a); int state; if(zero > i) state = 0; else state = 1; int l = 0, r = N-1; while(l < r){ int mid = (l + r) / 2; for(int j = 0; j <= mid; j++){ if(!mark[j]) a[j] = state; for(int j = mid + 1; j < N; j++){ if(!mark[j]) a[j] = 1 - state; } int ret = tryCombination(a); if(ret > i) r = mid; else l = mid + 1; } pos[i] = l; a[l] = state; mark[l] = true; } answer(a, pos); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:7: warning: unused variable 'one' [-Wunused-variable]
   15 |   int one = tryCombination(a);
      |       ^~~
cave.cpp:37:1: error: expected '}' at end of input
   37 | }
      | ^
cave.cpp:6:24: note: to match this '{'
    6 | void exploreCave(int N){
      |                        ^