# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
83412 | Tusk | Race (IOI11_race) | C++14 | 729 ms | 85308 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>
#define pii pair<int, int>
#define x first
#define y second
using namespace std;
const int N = 2e5 + 5;
const int M = 1e6 + 5;
int n, k;
int ans = -1, centroid, mxnode, cnt = 0;
int dep[N], path[M], dp[M];
vector<vector<pii> > g(N);
bitset<N> chk;
int subtree(int u, int p) {
dep[u] = 1;
for(pii v : g[u]) if(!chk[v.x] && v.x != p) {
dep[u] += subtree(v.x, u);
}
return dep[u];
}
void centdecomp(int u, int p, int all) {
int ret = all - dep[u];
for(pii v : g[u]) if(!chk[v.x] && v.x != p) {
centdecomp(v.x, u, all);
# | 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... |