# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
961104 | okkoo | Race (IOI11_race) | C++17 | 291 ms | 35652 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 <iostream>
#include <vector>
#include <queue>
#include <string.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int mxn = 2e5;
vector<vector<pair<int, int> > > adj(mxn+1, vector<pair<int, int> >());
int K;
int ans = 1e9;
bool processed[mxn+1];
int sz[mxn+1];
vector<int> lengths(mxn*5+1, 1e9);
int getSize(int node, int p){
sz[node] = 1;
for(pair<int, int> tmp: adj[node]){
int to = tmp.first;
if(!processed[to] && to!=p) sz[node] += getSize(to, node);
}
return sz[node];
}
int getCentroid(int node, int p, int mxSize){
for(pair<int, int> tmp: adj[node]){
int to = tmp.first;
if(!processed[to] && to!=p && sz[to] > mxSize) return getCentroid(to, node, mxSize);
}
return node;
# | 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... |