# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
201767 | EmmanuelAC | Putovanje (COCI20_putovanje) | C++14 | 477 ms | 48784 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>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long,long long>
using namespace std;
struct nd{
vector<ll> ady;
}T[200010];
ll n,u,v,a,b,d[200010],f[200010][20],sum[200010],ans;
map< pll , pll > c;
void dfs(ll node,ll ant,ll dist){
d[ node ] = dist;
f[ node ][ 0 ] = ant;
for(auto sig:T[node].ady){
if( sig==ant ) continue;
dfs( sig , node , dist+1 );
}
return;
}
ll lca( ll A , ll B ){
if( d[ A ] < d[ B ] ) swap( A , B );
for(int i=19; i>=0; i--) if( d[A]-(1LL<<i) >= d[ 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... |