Submission #77379

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
773792018-09-27 02:49:42joseacazRace (IOI11_race)C++17
100 / 100
720 ms65868 KiB
#include "race.h"
#include <vector>
#define MAXN 200005
#define MAXK 1000005
#define pii pair < int, int >
#define mp make_pair
using namespace std;
int C, K, tam[MAXN], dead[MAXN], tim[MAXK], arr[MAXK];
vector < pii > Graph[MAXN];
void pre_tam ( int node, int parent )
{
tam[node] = 1;
for ( auto i : Graph[node] )
if ( i.first != parent && !dead[i.first] )
pre_tam ( i.first, node ), tam[node] += tam[i.first];
}
int find_centroid ( int node, int parent, int siz )
{
for ( auto i : Graph[node] )
if ( i.first != parent && 2 * tam[i.first] > siz && !dead[i.first] )
return find_centroid ( i.first, node, siz );
return node;
}
int qry ( int node, int parent, int s, int a )
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...