# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
77379 | joseacaz | Race (IOI11_race) | C++17 | 720 ms | 65868 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 <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 )
{
# | 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... |