# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
341111 | ijxjdjd | Mergers (JOI19_mergers) | C++14 | 165 ms | 26500 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;
const int MAXN = (int)(5e5) + 5;
vector<int> adj[MAXN];
int up[MAXN][21];
int timer = 0;
int tin[MAXN];
int tout[MAXN];
int S[MAXN];
int last[MAXN];
int lcm[MAXN];
int cnt[MAXN];
void root(int n, int p) {
tin[n] = timer++;
up[n][0] = p;
for (int k = 1; k <= 20; k++) {
up[n][k] = up[up[n][k-1]][k-1];
}
for (int e : adj[n]) {
if (e != p) {
root(e, n);
}
}
tout[n] = timer++;
}
vector<int> dfs(int n, int p) {
int paths = 0;
vector<int> arr(3, 0);
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... |