# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
691869 | piOOE | Prize (CEOI22_prize) | C++17 | 2522 ms | 243396 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;
struct Tree {
vector<int> tin, tout, par, depth, jump;
int logn;
void init(vector<vector<int>> adj, int root) {
int n = adj.size();
int T = 0;
tin.assign(n, -1), tout.resize(n), par.resize(n), depth.resize(n), jump.resize(n);
par[root] = jump[root] = root;
function<void(int)> dfs = [&](int v) {
tin[v] = T++;
for (int to : adj[v]) {
depth[to] = depth[v] + 1;
par[to] = v;
int p = jump[v];
int pp = jump[p];
if (depth[p] - depth[v] == depth[pp] - depth[p]) {
jump[to] = pp;
} else {
jump[to] = v;
}
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... |