# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
297203 | alexandra_udristoiu | Race (IOI11_race) | C++14 | 244 ms | 45416 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>
#include<algorithm>
#define DIM 100005
#define f first
#define s second
using namespace std;
int viz[DIM], num[DIM], d[1000005];
vector< pair<int, int> > v[DIM];
struct str{
int nod, d, dist, tf;
};
vector<str> w[DIM];
void dfs1(int nod, int t){
num[nod] = 1;
for(int i = 0; i < v[nod].size(); i++){
int vecin = v[nod][i].f;
if(vecin != t && viz[vecin] == 0){
dfs1(vecin, nod);
num[nod] += num[vecin];
}
}
}
int findcen(int nod, int t, int k){
for(int i = 0; i < v[nod].size(); i++){
int vecin = v[nod][i].f;
if(vecin != t && viz[vecin] == 0){
if(num[vecin] > k / 2){
return findcen(vecin, nod, k);
}
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... |