# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
583321 | AGE | Putovanje (COCI20_putovanje) | C++14 | 513 ms | 87616 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 F first
#define S second
#define pb push_back
#define int long long
using namespace std;
const int N=1e6,M=2e3,mod=1e9+7;
int n,up[N][30],innode[N],outnode[N],timee=0,val[N],val2[N];
map<pair<int,int>,int>mpp;
vector<int>adj[N];
vector<pair<int,int>>v;
void dfs(int node,int par){
innode[node]=timee++;
up[node][0]=par;
for(int j=1;j<ceil(log2(n));j++)
up[node][j]=up[up[node][j-1]][j-1];
for(auto x:adj[node]){
if(x==par)
continue;
dfs(x,node);
}
outnode[node]=timee++;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |