Submission #96998

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
969982019-02-13 08:23:16tugushka경주 (Race) (IOI11_race)C++14
100 / 100
2077 ms36620 KiB
#include "race.h"
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define N 200005
using namespace std;
using pii = pair < int, int >;
map < int, int > x, y;
vector < vector < pair < int, int > > > to;
int n, k, sz[N], res = 1e9;
bool blocked[N];
int get_size(int u, int p){
sz[u] = 1;
for( pii v : to[u] ){
if( blocked[v.first] || v.first == p ) continue;
sz[u] += get_size( v.first, u );
}
return sz[u];
}
int get_center( int u, int p, int comp_size ){
for( pii v : to[u] ){
if( blocked[v.first] || v.first == p ) continue;
if( sz[v.first] > comp_size ) return get_center(v.first, u, comp_size);
}
return u;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...