# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
82791 | vibster | Race (IOI11_race) | C++14 | 1823 ms | 158172 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 endl '\n'
#define INF 1e18
typedef long long int ll;
using namespace std;
const int NMAX=2e5+1, LOGN=19, NMAX2=1e6+1;
int sz[NMAX];
ll k;
vector <set<pair<int,int>>> node(NMAX);
multiset <int> dis[NMAX2];
ll ans=INF;
//Decompose
//subtree size
int dfs0(int u, int p){
sz[u]=1;
for(auto b: node[u]){
if(b.first==p)continue;
sz[u]+=dfs0(b.first, u);
}
return sz[u];
}
//find centroid
int dfs1(int u, int p, int n){
for(auto b:node[u]){
if(b.first==p)continue;
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... |