# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
710852 | Darren0724 | Jail (JOI22_jail) | C++17 | 1318 ms | 287696 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=120005;
const int K=18;
int n,m;
vector<vector<int>> adj;
vector<vector<int>> g;
vector<vector<int>> jump(K,vector<int>(N));
vector<int> deep(N);
vector<int> s1;
vector<int> t1;
void dfs(int k,int pa){
jump[0][k]=pa;
for(int i=1;i<K;i++){
jump[i][k]=jump[i-1][jump[i-1][k]];
}
for(int j:adj[k]){
if(j==pa){
continue;
}
deep[j]=deep[k]+1;
dfs(j,k);
}
}
int lca(int a,int b){
if(deep[a]<deep[b]){
swap(a,b);
}
int d=deep[a]-deep[b];
for(int i=0;i<K;i++){
# | 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... |