제출 #1117258

#제출 시각아이디문제언어결과실행 시간메모리
1117258I_FloPPed21슈퍼트리 잇기 (IOI20_supertrees)C++14
컴파일 에러
0 ms0 KiB
#include "supertrees.h"
#include <iostream>
#include <vector>

using namespace std;
const int N=1001;
int n,b[N][N],componente[N],cnt,root[N],modes[N][N];
bool viz[N];
void fa_dfs(int i)
{
    viz[i]=true;
    componente[i]=cnt;
    for(int j=0; j<n; j++)
    {
        if(viz[j]==true)
            continue;
        if(modes[i][j]==1)
        {
            fa_dfs(j);
        }
    }
}
int construct(vector<vector<int>>p)
{
    n=p.size();
    for(int i=0; i<n; i++)
        for(int j=0; j<n; j++)
            modes[i][j]=p[i][j];
    for(int i=0; i<n; i++)
    {
        if(viz[i]==false)
        {
            cnt++;
            viz[i]=true;
            componente[i]=cnt;
            fa_dfs(i);

        }
    }
    build(b);
    return 1;

}
int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

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

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:40:11: error: could not convert '(int (*)[1001])(& b)' from 'int (*)[1001]' to 'std::vector<std::vector<int> >'
   40 |     build(b);
      |           ^
      |           |
      |           int (*)[1001]