# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
173226 | aer0park | Race (IOI11_race) | C++14 | 0 ms | 0 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 <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef pair<pi,ll> pii;
ll anw=1e16,n,k,cen,del[200005],sz[200005];
pi pth[200005];
map<pi,ll> l;
vector<ll> g[200005];
vector<pii> ar;
void gtsz(ll a,ll p)
{
sz[a]=1;
for(int i=0;i<g[a].size();i++)
if(g[a][i]!=p&&!del[g[a][i]])
gtsz(g[a][i],a),sz[a]+=sz[g[a][i]];
}
void fdcen(ll a,ll p,ll mxsz)
{
ll mx=0;
for(int i=0;i<g[a].size();i++)
if(g[a][i]!=p&&sz[g[a][i]]>mxsz/2&&!del[g[a][i]])
fdcen(g[a][i],a,mxsz);