제출 #336883

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

//Subtask 1: D[i] == i

void exploreCave(int N)
{
    int S[N];
    for(int i = 0; i < N; i++) Q[i] = 0;

    int D[N];
    for(int i = 0; i < N; i++) D[i] = i;

    int q;
    while(1)
    {
        q = tryCombination(S);
        if(q == -1)
        {
            answer(S);
            return;
        }
        else S[q] = !S[q];
    }
}

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:11:32: error: 'Q' was not declared in this scope
   11 |     for(int i = 0; i < N; i++) Q[i] = 0;
      |                                ^
cave.cpp:22:21: error: too few arguments to function 'void answer(int*, int*)'
   22 |             answer(S);
      |                     ^
In file included from cave.cpp:1:
cave.h:9:6: note: declared here
    9 | void answer(int S[], int D[]);
      |      ^~~~~~