# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
410228 | egod1537 | 족보 (KOI18_family) | C++14 | 35 ms | 60184 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 MAX 300001
vector<int> A[MAX], B[MAX];
vector<int> newA[MAX], newB[MAX];
int pa[MAX], pb[MAX];
int dsu[MAX];
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 num = 0;
void dfsA(int pos) {
num++;
for (int w : A[pos]) {
newA[find(pos)].push_back(find(w));
dfsA(w);
}
}
void dfsB(int pos) {
num++;
# | 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... |