# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
898395 | limbo16 | Magic Tree (CEOI19_magictree) | C++14 | 125 ms | 52356 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 all(a) a.begin(), a.end()
#define allr(a) a.rbegin(), a.rend()
#define len(a) (int)a.size()
#define endl '\n'
#define int long long
using namespace std;
const int INF = 1e18;
const int MAXN = 2e5 + 100;
vector<int> g[MAXN];
map<int, int> stored_map[MAXN];
map<int, int> global_map;
int subtree[MAXN], fruit_time[MAXN], fruit_weight[MAXN], has_fruit[MAXN];
void dfs1(int u) {
subtree[u] = 1;
for (int v : g[u]) {
dfs1(v);
subtree[u] += subtree[v];
}
}
void dfs2(int u, bool store_info = true) {
int max_subtree_v = -1;
for (int v : g[u]) {
if (max_subtree_v == -1 || subtree[v] > subtree[max_subtree_v])
max_subtree_v = v;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |