# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
185578 | kdh9949 | Race (IOI11_race) | C++17 | 492 ms | 70796 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>
#include "race.h"
using namespace std;
using pii = pair<int, int>;
#define x first
#define y second
const int N = 200005;
int n, k, res = N;
vector<pii> e[N];
struct SET{
set<pii> s;
pii ofs;
SET(): ofs(0, 0) { s.emplace(0, 0); }
};
SET *f(int x, int y){
if(x && e[x].size() == 1) return new SET();
vector<SET*> v;
SET* mx = NULL;
for(pii i : e[x]){
if(i.x == y) continue;
v.push_back(f(i.x, x));
v.back()->ofs.x += i.y;
v.back()->ofs.y++;
if(!mx || mx->s.size() < v.back()->s.size()) mx = v.back();
}
# | 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... |