# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
937765 | Hugo1729 | Connecting Supertrees (IOI20_supertrees) | C++17 | 183 ms | 23452 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 "supertrees.h"
#include <bits/stdc++.h>
using namespace std;
struct DSU{
int n;
vector<int> e;
DSU(int s){
n=s;e.assign(n,-1);
}
int find(int v){
return (e[v]<0?v:e[v]=find(e[v]));
}
bool same(int a, int b){
return find(a)==find(b);
}
bool connect(int a, int b){
a=find(a);b=find(b);
if(a==b)return 0;
if(e[a]>e[b])swap(a,b);
e[a]+=e[b];
e[b]=a;
return 1;
}
};
int construct(vector<vector<int>> p) {
int n = p.size();
DSU groups(n),rep(n);
Compilation message (stderr)
# | 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... |