제출 #670980

#제출 시각아이디문제언어결과실행 시간메모리
670980birthdaycakeCave (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#include "cave.h"
using namespace std;
void exploreCave(int n) {
    int vs[n],val[n],sw[n];
    memset(vs, 0, sizeof vs);
    memset(val, 0, sizeof val);
    memset(sw, 0, sizeof sw);
    
    
    for(int i = 0; i < n; i++){
        int comb = 0;
        for(int j = 0; j < n; j++){
            if(!vs[j]) val[j] = 0;
        }
        int x = tryCombination(val);
        if(x == i) comb = 1;
        int l = 0, r = n - 1;
        while(l < r){
            int mid = (l + r) / 2;
            for(int j = l; j <= mid; j++){
                if(!vs[j]) val[j] = comb;
            }
            for(int j = 0; j < mid; j++){
                if(!vs[j]) val[j] = !combo;
            }
            for(int j = mid + 1; j < n; j++){
                if(!vs[j]) val[j] = !combo;
            }
            int x = tryCombination(val);
            if(x == i){
                r = mid;
            }else{
                l = mid + 1;
            }
        }
        val[r] = comb;
        sw[r] = comb;
        vs[r] = 1;
    }
    answer(val, sw);
}

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:25:38: error: 'combo' was not declared in this scope; did you mean 'comb'?
   25 |                 if(!vs[j]) val[j] = !combo;
      |                                      ^~~~~
      |                                      comb
cave.cpp:28:38: error: 'combo' was not declared in this scope; did you mean 'comb'?
   28 |                 if(!vs[j]) val[j] = !combo;
      |                                      ^~~~~
      |                                      comb