Submission #1100281

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11002812024-10-13 11:59:22kokoueRace (IOI11_race)C++14
100 / 100
631 ms36960 KiB
#include<bits/stdc++.h>
#include "race.h"
#define maxn 200010
#define maxk 1000010
#define f first
#define s second
#define ll long long
using namespace std;
int n,k;
int subsz[maxn],cnt[maxk];
bool is_cen[maxn];
int mx_sz=0;
int ans=INT_MAX;
vector<pair<int,int>> edges[maxn];
int get_size(int start,int parent=-1)
{
int sz=1;
for(auto e:edges[start])
{
if(e.f==parent || is_cen[e.f]) continue;
sz+=get_size(e.f,start);
}
return subsz[start]=sz;
}
int find_centroid(int start,int tree_sz,int parent=-1)
{
for(auto e:edges[start])
{
if(e.f==parent || is_cen[e.f]) continue;
if(2*subsz[e.f]>tree_sz) return find_centroid(e.f,tree_sz,start);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...