# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
963890 | huutuan | Reconstruction Project (JOI22_reconstruction) | C++14 | 1316 ms | 43232 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>
using namespace std;
#define int long long
struct DSURollback{
vector<int> lab;
int cc;
void init(int n){
lab.assign(n+1, -1);
cc=n;
}
int find_set(int u){
return lab[u]<0?u:lab[u]=find_set(lab[u]);
}
bool union_sets(int u, int v){
u=find_set(u); v=find_set(v);
if (u!=v){
if (lab[u]>lab[v]) swap(u, v);
lab[u]+=lab[v];
lab[v]=u;
--cc;
return 1;
}
return 0;
}
bool same(int u, int v){
return find_set(u)==find_set(v);
}
# | 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... |