# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
38869 | moonrabbit2 | 트리 (KOI16_tree) | C++14 | 456 ms | 38356 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 N 200005
#define pb push_back
using namespace std;
typedef long long ll;
int n,q,par[N];
vector<int> child[N];
int sub[N],lev[N];
vector<int> chain[N];
int where[N],place[N],c_chain;
vector<ll>tree[N];
bool linked[N];
void dfs(int curr)
{
sub[curr]=1;
for(auto &i : child[curr]){
lev[i]=lev[curr]+1;
dfs(i);
sub[curr]+=sub[i];
}
}
void hld(int curr)
{
where[curr]=c_chain;
chain[c_chain].pb(curr);
int idx=-1;
for(auto &i : child[curr]){
if(idx==-1||sub[i]>sub[idx])
idx=i;
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |