# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
223191 | oolimry | Putovanje (COCI20_putovanje) | C++14 | 125 ms | 18912 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;
static vector<int> adj[100005];
static int heavy[100005];
static int depth[100005];
static int head[100005];
static int p[100005];
static int pos[100005];
static int sz[100005];
int cnt = 0; ///set to 1 if you're using fenwick tree
void dfs(int u){
sz[u] = 1;
int maxChild = 0;
for(int v : adj[u]){
if(sz[v] == 0){
depth[v] = depth[u] + 1;
dfs(v);
sz[u] += sz[v];
p[v] = u;
if(sz[v] > maxChild){
maxChild = sz[v];
heavy[u] = v;
}
}
}
}
void decompose(int u, int h){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |