#include <bits/stdc++.h>
#include "supertrees.h"
using namespace std;
void build(vector<vector<int>> b);
struct DSU {
vector<int> link, siz;
DSU (int n) : link(n), siz(n, 1) {
iota(link.begin(), link.end(), 0ll);
}
int get(int x) {
if (link[x] == x) {
return x;
}
return link[x] = get(link[x]);
}
bool unite(int a, int b) {
a = get(a), b = get(b);
if (a == b) {
return false;
}
if (siz[a] < siz[b]) {
swap(a, b);
}
link[b] = a;
siz[a] += siz[b];
return true;
}
bool same(int a, int b) {
return (get(a) == get(b));
}
};
int construct(vector<vector<int>> p) {
vector<vector<int>> b(p.size(), vector<int>(p.size()));
for (int i = 0; i < n - 1; i++) {
b[i][i + 1] = 1;
b[i + 1][i] = 1;
}
build(b);
return 1;
}
Compilation message
supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:44:22: error: 'n' was not declared in this scope
44 | for (int i = 0; i < n - 1; i++) {
| ^