# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
797380 | kingfran1907 | Birthday gift (IZhO18_treearray) | C++14 | 1385 ms | 80932 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;
const int maxn = 2e5+10;
const int logo = 20;
int n, m, q;
vector< int > graph[maxn];
int dp[logo + 10][maxn];
int dis[maxn];
int niz[maxn];
map< int, set< pair<int, int> > > qs;
void dfs(int x, int parr) {
dp[0][x] = parr;
dis[x] = 1 + dis[parr];
for (int tren : graph[x]) {
if (tren != parr) dfs(tren, x);
}
}
int lif(int x, int val) {
for (int i = 0; i < logo; i++)
if (val & (1 << i)) x = dp[i][x];
return x;
}
int lca(int a, int b) {
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... |