# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
401868 | fadi57 | Putovanje (COCI20_putovanje) | C++14 | 168 ms | 22872 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 mx=15;
typedef long long ll;
int inf=1e9+10;
const int mod=1e9+7;
int n,m;
vector<pair<int,pair<ll,ll>>> adj[200002];
int dp[2000001][22];
int depth[mx];
void dfs(int node,int p){
dp[node][0]=p;
for(int i=1;i<=20;i++){
dp[node][i]=dp[dp[i][i-1]][i-1];
}
for(auto it:adj[node]){
if(it.first!=p){
depth[it.first]=depth[node]+1;
dfs(it.first,node);
}
}
return;
}
int kth(int node,int k){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |