# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
667216 | atigun | Connecting Supertrees (IOI20_supertrees) | C++17 | 214 ms | 24032 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;
typedef long long ll;
struct dsu{
vector<int> parent, size;
int N;
void assign(int dsusize){
N = dsusize;
parent.assign(N, 0);
iota(parent.begin(), parent.end(), 0);
size.assign(N, 1);
}
int find(int v){
return parent[v] = (parent[v] == v ? v : find(parent[v]));
}
void merge(int v, int u){
if(find(v) == find(u))
return;
if(size[find(v)] < size[find(u)])
swap(u, v);
size[find(v)]+= size[find(u)];
parent[find(u)] = parent[find(v)];
}
bool is_same(int v, int u){
return (find(v) == find(u));
}
};
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... |