# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
545533 | AlperenT | Putovanje (COCI20_putovanje) | C++17 | 206 ms | 37692 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 N = 2e5 + 5, K = 20;
long long n, a, b, c1, c2, ans, cnt[N], binlift[N][K], depth[N];
struct Edge{
long long b, c1, c2;
};
vector<Edge> tree[N];
void dfs(int v, int p){
binlift[v][0] = p;
for(int i = 1; i < K; i++) binlift[v][i] = binlift[binlift[v][i - 1]][i - 1];
depth[v] = depth[p] + 1;
for(auto e : tree[v]){
if(e.b != p){
dfs(e.b, v);
}
}
}
int lca(int a, int b){
if(depth[b] > depth[a]) swap(a, b);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |