# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
410186 | egod1537 | 족보 (KOI18_family) | C++14 | 19 ms | 35560 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;
int dsu[300001], pa[300001], pb[300001];
vector<int> S[300001];
vector<int> A[300001], B[300001];
vector<int> depA[300001], depB[300001];
int find(int x) {
return (dsu[x] == 0) ? x : (dsu[x] = find(dsu[x]));
}
void merge(int a, int b) {
a = find(a), b = find(b);
if (a == b) return;
dsu[b] = a;
}
int da, db;
void dfsA(int pos, int dep) {
depA[dep].push_back(pos);
da = max(da, dep);
for (int w : A[pos]) dfsA(w, dep+1);
}
void dfsB(int pos, int dep) {
depB[dep].push_back(pos);
db = max(db, dep);
for (int w : B[pos]) dfsB(w, dep + 1);
}
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... |