# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
105923 | tincamatei | Race (IOI11_race) | C++14 | 682 ms | 100428 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;
const int MAX_N = 200000;
vector<pair<int, int> > graph[MAX_N];
set<pair<long long, int> > chains[MAX_N];
long long lazy[MAX_N];
int lazyedge[MAX_N];
int rez = MAX_N + 1;
int subtree[MAX_N];
void predfs(int nod, int papa = -1) {
subtree[nod]++;
for(auto it: graph[nod])
if(it.first != papa) {
predfs(it.first, nod);
subtree[nod] += subtree[it.first];
}
}
void solvedfs(int nod, int k, int papa = -1) {
int heavySon = -1;
for(auto it: graph[nod])
if(it.first != papa && (heavySon == -1 || (heavySon != -1 && subtree[it.first] > subtree[heavySon])))
heavySon = it.first;
# | 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... |