# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
91516 | faustaadp | Race (IOI11_race) | C++17 | 1071 ms | 114648 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 ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll n,k,has,b[202020],besar[202020],calon,me[1010101],i;
vector<ll> v[202020];
vector<ll> w[202020];
void dfs(ll aa,ll bb,ll cc)
{
ll ii,ma=0;
besar[aa]=1;
for(ii=0;ii<v[aa].size();ii++)
if((v[aa][ii]!=bb)&&(!b[v[aa][ii]]))
{
dfs(v[aa][ii],aa,cc);
besar[aa]+=besar[v[aa][ii]];
ma=max(ma,besar[v[aa][ii]]);
}
//cout<<aa<<" "<<ma<<" "<<(cc-besar[aa])<<"\n";
if((ma<=(cc/2))&&((cc-besar[aa])<=(cc/2)))calon=aa;
}
void dfs2(ll aa,ll bb)
{
ll ii,ma=0;
besar[aa]=1;
for(ii=0;ii<v[aa].size();ii++)
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... |