# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
906506 | Nonoze | Cat Exercise (JOI23_ho_t4) | C++17 | 628 ms | 88792 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 int long long
int n;
vector<int> parent;
vector<bool> already;
vector<vector<int>> adj;
vector<int> vaut;
vector<vector<int>> adjbase;
vector<int> depth;
vector<vector<int>> up;
//LCA
int get_lca(int a, int b) {
if (depth[a] < depth[b]) swap(a, b);
int k=depth[a]-depth[b];
for (int j=19; j>=0; j--) {
if (k & (1<<j)) {
a=up[a][j];
}
}
if (a==b) return a;
for (int j=19; j>=0; j--) {
if (up[a][j]!=up[b][j]) {
a=up[a][j];
b=up[b][j];
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |