제출 #393060

#제출 시각아이디문제언어결과실행 시간메모리
393060abdzag슈퍼트리 잇기 (IOI20_supertrees)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include<unordered_set> #include "supertrees.h" #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> #define rep(i,a,b) for(int i = a; i<int(b);++i) #define rrep(i,a,b) for(int i = a; i>int(b);--i) #define all(v) v.begin(),v.end() #define trav(a, x) for(auto& a : x) typedef long long ll; const long long inf = 1e15; using namespace std; void printint(vector < ll > vec) { for (auto a : vec) { cout << a << " "; } cout << endl; } bool sortcol(const vector<int>& v1, const vector<int>& v2) { return v1[1] < v2[1]; } void printsetint(set<ll> s) { for (auto it = s.begin(); it != s.end(); ++it) { cout << *it; } } void printsetpairint(set<pair<int, int>> s) { for (auto it = s.begin(); it != s.end(); ++it) { pair<int, int> cur = *it; cout << cur.first << " " << cur.second; } cout << endl; } void printsetstring(set<string> s) { for (auto it = s.begin(); it != s.end(); ++it) { cout << *it << endl; } } vector<ll> p(2001); vector<ll> Urank(2001); ll UfindSet(ll i) { if (p[i] == i)return i; return p[i] = UfindSet(p[i]); } void UjoinSet(ll i, ll j) { ll si = UfindSet(i); ll sj = UfindSet(j); if (sj == si) return; if (Urank[sj] > Urank[si]) swap(i, j); p[sj] = si; if (Urank[si] == Urank[sj])Urank[si]++; return; } void build(vector<vector<ll>>b); ll construct(vector<vector<ll>> v) { rep(i, 0, p.size())p[i] = i; ll n = v.size(); rep(i, 0, n) { rep(j, 0, n) { if (v[i][j]) { UjoinSet(i, j); } } } vector<vector<ll>> ans(n, vector<ll>(n)); rep(i, 0, n) { if (p[i] != i) { ans[i][p[i]] = 1; ans[p[i]][i] = 1; } } build(ans); return 1; }

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

/tmp/cc9CENWG.o: In function `construct(std::vector<std::vector<long long, std::allocator<long long> >, std::allocator<std::vector<long long, std::allocator<long long> > > >)':
supertrees.cpp:(.text+0x6d6): undefined reference to `build(std::vector<std::vector<long long, std::allocator<long long> >, std::allocator<std::vector<long long, std::allocator<long long> > > >)'
/tmp/cctvhux8.o: In function `main':
grader.cpp:(.text.startup+0x3dc): undefined reference to `construct(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)'
collect2: error: ld returned 1 exit status