# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
463494 | Jasiekstrz | Putovanje (COCI20_putovanje) | C++17 | 228 ms | 28396 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 fi first
#define se second
using namespace std;
const int N=2e5;
const int L=20;
const int PP=3e5;
int pot;
int tree[2*PP+10];
vector<pair<int,int>> e[N+10];
long long c[N+10][2];
int pre[N+10];
int post[N+10];
int d[N+10];
int jmp[N+10][L+2];
void dfs_pre(int x,int p)
{
static int nr=0;
pre[x]=++nr;
d[x]=d[p]+1;
jmp[x][0]=p;
for(int l=1;l<=L;l++)
jmp[x][l]=jmp[jmp[x][l-1]][l-1];
for(auto [v,id]:e[x])
{
if(v==p)
continue;
dfs_pre(v,x);
}
post[x]=nr;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |