제출 #125250

#제출 시각아이디문제언어결과실행 시간메모리
125250khulegub동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> int n; int start; bool uz[5005]; int s[5005], d[5005]; void soli(int l, int r){ for (int i = l; i <= r; i++) uz[i] = !uz[i]; } void exploreCave(int N) { n = N; memset(uz, 0, sizeof uz); for (int i = 0; i < n; i++){ start = i; if (tryCombination(uz) < i) soli(i, n - 1); s[i] = uz[i]; // now uz is guaranteed to produce i<= int l = i, r = n - 1; while (l != r){ int mid = (l + r) >> 1; soli(l, mid); int tmp = tryCombination(uz); soli(l, mid); if(tmp >= i){ //zuun tald r = mid; } else{ //baruun tald l = mid + 1; } } d[l] = i; } answer(s, d); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:24: error: cannot convert 'bool*' to 'int*' for argument '1' to 'int tryCombination(int*)'
   if (tryCombination(uz) < i) soli(i, n - 1);
                        ^
cave.cpp:22:31: error: cannot convert 'bool*' to 'int*' for argument '1' to 'int tryCombination(int*)'
    int tmp = tryCombination(uz);
                               ^