# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
704668 | piOOE | Reconstruction Project (JOI22_reconstruction) | C++17 | 5061 ms | 223252 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;
using ll = long long;
constexpr int Q = 1e5 + 1, N = 500;
vector<int> save[Q];
array<int, 3> e[Q];
int fa[N], sz[N];
void init() {
iota(fa, fa + N, 0);
fill_n(sz, N, 1);
}
int leader(int x) {
return x == fa[x] ? x : fa[x] = leader(fa[x]);
}
bool unite(int x, int y) {
x = leader(x), y = leader(y);
if (x == y) {
return false;
}
if (sz[x] < sz[y]) {
swap(x, y);
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... |