# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
857793 | NguyenTN091106 | Putovanje (COCI20_putovanje) | C++14 | 92 ms | 28520 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 ff first
#define ss second
#define mp(x,y) make_pair((x),(y))
#define bit(x,i) (((x)>>(i))&1)
#define MASK(i) (1<<(i))
#define randomize mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count())
using namespace std;
const int maxn=2e5+5;
const ll oo=2e18+5;
const int MOD=1e9+7;
const int inf=1e9+7;
void init()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
}
int n,c[2][maxn],pa[maxn][20],depth[maxn];
vector< pair<int,int> > adj[maxn];
void dfs(int u,int pre)
{
for(int it=0;it<(int)adj[u].size();it++)
{
int v=adj[u][it].ff;
if(v==pre) continue;
depth[v]=depth[u]+1;
pa[v][0]=u;
for(int j=1;j<=18;j++) pa[v][j]=pa[pa[v][j-1]][j-1];
dfs(v,u);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |