# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
782061 | bane | Connecting Supertrees (IOI20_supertrees) | C++17 | 184 ms | 22440 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "supertrees.h"
using namespace std;
struct DisjointSetUnion{
int N;
vector<int>sz;
vector<int>link;
DisjointSetUnion(int n): N(n){
sz.resize(n);
link.resize(n);
for (int i = 0; i < n; i++){
link[i] = i;
sz[i] = 1;
}
}
int Find(int a){
if (a == link[a])return a;
return link[a] = Find(link[a]);
}
bool Unite(int a, int b){
a = Find(a), b = Find(b);
if (a == b)return false;
if (sz[a] < sz[b])swap(a,b);
sz[a] += sz[b];
link[b] = a;
return true;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |