# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
29270 | inqr | Race (IOI11_race) | C++14 | 6 ms | 5880 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 <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define rt insert
#define st first
#define nd second
#define DB printf("debug\n");
using namespace std;
int n,k,ans=1e9;
vector < pair < int , int > > ed[200005];
vector < bool > cenbef(200005,0);
vector < int > subcnt(200005,0);
int sub_count(int vn,int vb){//kendisi dahil
subcnt[vn]=1;
for(int i=0;i<ed[vn].size();i++){
int vnx=ed[vn][i].st;
if(!cenbef[vnx]&&vnx!=vb){
subcnt[vn]+=sub_count(vnx,vn);
}
}
return subcnt[vn];
}
int find_cen(int vn,int vb,int ts){
for(int i=0;i<ed[vn].size();i++){
int vnx=ed[vn][i].st;
if(!cenbef[vnx]&&vnx!=vb&&subcnt[vnx]>ts/2)
return find_cen(vnx,vn,ts);
}
return vn;
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... |