제출 #655457

#제출 시각아이디문제언어결과실행 시간메모리
655457angelo_torres동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
// #include "cave.h"
 
using namespace std;

int vis[5005],S[5005],D[5005];

void exploreCave(int N) {
    for(int i = 0; i < N; ++i) S[i] = 0;
    for(int i = 0; i < N; ++i){
        bool fl = (i == tryCombination(S));
        int l = 0, r = N-1;
        while(r != l){
            int md = (l+r)>>1;
            int kl = l, kr = md;
            for(int j = l; j <= md; ++j) if(!vis[j]) S[j] = 1-S[j];
            bool gl = (i == tryCombination(S));
            if(fl == gl) l = md+1;
            else r = md;
            for(int j = kl; j <= kr; ++j) if(!vis[j]) S[j] = 1-S[j];
        }
        if(fl) S[l] = 1-S[l];
        D[l] = i, vis[l] = 1;
    }
    answer(S,D);
}

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:25: error: 'tryCombination' was not declared in this scope
   11 |         bool fl = (i == tryCombination(S));
      |                         ^~~~~~~~~~~~~~
cave.cpp:25:5: error: 'answer' was not declared in this scope
   25 |     answer(S,D);
      |     ^~~~~~