# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
34569 | top34051 | Race (IOI11_race) | C++14 | 897 ms | 58620 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 "race.h"
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define X first
#define Y second
const int maxn = 200005;
const int inf = 1e6;
int n,k,ans;
int cur, h[maxn], sz[maxn], st[maxn], ft[maxn], p[maxn];
long long sum[maxn];
vector<int> go[maxn];
vector<pii> edge[maxn];
map<long long,int> s;
void dfs(int u,int last) {
st[u] = ++cur; p[cur] = u;
sz[u] = 1; h[u] = h[last]+1;
for(auto t : edge[u]) {
int v = t.X, val = t.Y;
if(v!=last) {
sum[v] = sum[u] + val;
dfs(v,u);
sz[u] += sz[v];
}
}
ft[u] = cur;
// printf("%d : [%d, %d] h = %d sz = %d sum = %lld\n",u,st[u],ft[u],h[u],sz[u],sum[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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |