Submission #393091

#TimeUsernameProblemLanguageResultExecution timeMemory
393091abdzagConnecting Supertrees (IOI20_supertrees)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include"supertrees.h" #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,v) for(auto& a: v) typedef long long ll; using namespace std; const long long inf = 1e15; vector<ll> p(2001); vector<ll> Rank(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 ( Rank[sj]> Rank[si])swap(sj, si); p[sj] = si; if (Rank[sj] == Rank[si]) Rank[si]++; } int constrct(vector<vector<int>> v) { rep(i, 0, 2001)p[i] = i; rep(i, 0, v.size()) { rep(j, 0, v.size()) { if (v[i][j]) UjoinSet(i, j); } } vector<vector<int>> b(v.size(), vector<int>(v.size())); rep(i, 0, v.size()) { if (p[i] != i) { b[i][p[i]]=1; b[p[i]][i] = 1; } } vector<vector<int>> check(v.size(), vector<int>(v.size())); rep(i, 0, v.size()) { vector<int> curvec(v.size()); queue<ll> q; q.push(i); while (!q.empty()) { ll cur = q.front(); curvec[cur] = 1; trav(a, b[cur])if (!curvec[a])q.push(a); } check[i] = curvec; } if (b != check)return 0; build(b); return 1; }

Compilation message (stderr)

/tmp/ccRzNsri.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