제출 #582089

#제출 시각아이디문제언어결과실행 시간메모리
582089MohamedFaresNebiliConnecting Supertrees (IOI20_supertrees)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "supertrees.h" #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; using ll = long long; using pi = pair<ll, pair<ll, ll>>; using ii = pair<int, int>; #define pb push_back #define pp pop_back #define ff first #define ss second typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; int N, par[1001]; int findSet(int v) { if(par[v] == v) return v; return par[v] = findSet(par[v]); } void unionSet(int u, int v) { u = findSet(u), v = findSet(v); par[u] = v; } int construct(vector<vector<int>> P) { N = P.size(); int B[N][N]; memset(B, 0, sizeof B); for(int l = 0; l < N; l++) par[l] = l; for(int l = 0; l < N; l++) { for(int i = l + 1; i < N; i++) { if(findSet(l) == findSet(i)) continue; B[l][i] = B[i][l] = 1; unionSet(l, i); } } build(B); return 1; }

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

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:43:19: error: could not convert '(int (*)[N])(& B)' from 'int (*)[N]' to 'std::vector<std::vector<int> >'
   43 |             build(B);
      |                   ^
      |                   |
      |                   int (*)[N]