제출 #744402

#제출 시각아이디문제언어결과실행 시간메모리
744402Elvin_FritlCave (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;

#include "cave.h"

void exploreCave(int n) {
    vector<int>chek(n,0),v;
    int d[n],s[n];
    for(int i=0;i<n;i++){
        s[i]=0;
    }
    int time=1;

    while(time<=n){
        int toto=tryCombination(s);
        if(toto >= time){
            for(int i=0;i<n;i++){
                if(chek[i]==0){
                    s[i]=(s[i]+1)%2;
                    int toto2=tryCombination(s);
                    if(toto2 == toto-1){
                        v.push_back(i);
                        color[i]=1;
                        break;
                    }
                    s[i]=(s[i]+1)%2;
                }
            }
        }
        else{
            for(int i=0;i<n;i++){
                if(chek[i]==0){
                    s[i]=(s[i]+1)%2;
                    int toto2=tryCombination(s);
                    if(toto2 == toto){
                        v.push_back(i);
                        color[i]=1;
                        break;
                    }
                    s[i]=(s[i]+1)%2;
                }
            }
        }
        time++;
    }

    for(int i=0;i<n;i++){
        d[i]=v[i];
    }

    answer(s,d);

}

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:24:25: error: 'color' was not declared in this scope
   24 |                         color[i]=1;
      |                         ^~~~~
cave.cpp:38:25: error: 'color' was not declared in this scope
   38 |                         color[i]=1;
      |                         ^~~~~