제출 #206907

#제출 시각아이디문제언어결과실행 시간메모리
206907vardan__02Cave (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstring>
#include <string>
#include <vector>
#include <cstdio>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <set>
#include <map>
#include "cave.h"
using namespace std;
typedef long long ll;
#define MP make_pair
#define PB push_back
int s[5005],d[5005];
void get_d(int S[], int ss)
{
    for(int i=0;i<ss;i++)
    {
        S[i]=(S[i]+1)%2;
        int x=tryCombination(S);
        d.PB(x);
        S[i]=(S[i]+1)%2;
    }
    answer(S,d);
}
void exploreCave(int N)
{
    int n = N, x = 0, y = 0;
    for(int i=0;i<n;i++)
        s.PB(0);
    int i=0;
    while(i<=n-2)
    {
        x=tryCombination(s);
        if(x==-1)
        {
            get_d(s,n);
            return;
        }
        s[i+1]=(s[i+1]+1)%2;
        y=tryCombination(s);
        if(y==-1)
        {
            get_d(s,n);
            return;
        }
        if(x==y)
            s[i]=(s[i]+1)%2;
        i++;
    }
    x=tryCombination(s);
    if(x!=-1)
        s[n-1]=(s[n-1]+1)%2;
    get_d(s,n);
    return;
}

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

cave.cpp: In function 'void get_d(int*, int)':
cave.cpp:18:12: error: request for member 'push_back' in 'd', which is of non-class type 'int [5005]'
 #define PB push_back
            ^
cave.cpp:26:11: note: in expansion of macro 'PB'
         d.PB(x);
           ^~
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:18:12: error: request for member 'push_back' in 's', which is of non-class type 'int [5005]'
 #define PB push_back
            ^
cave.cpp:35:11: note: in expansion of macro 'PB'
         s.PB(0);
           ^~