Submission #393385

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3933852021-04-23 10:54:19juggernautRace (IOI11_race)C++14
100 / 100
524 ms36220 KiB
#include"race.h"
#include<bits/stdc++.h>
#ifdef IOI2021SG
#include"grader.cpp"
#endif
using namespace std;
#define fr first
#define sc second
vector<pair<int,int>>g[200005];
const int INF=2e9;
int k,ans=INF;
int sz[200005];
bool vis[200005];
pair<int,int>mt[1000005];
int timer;
void calc_sz(int v,int p){
sz[v]=1;
for(auto to:g[v])if(to.fr!=p&&!vis[to.fr]){
calc_sz(to.fr,v);
sz[v]+=sz[to.fr];
}
}
int centroid(int v,int p,int num){
for(auto to:g[v])if(to.fr!=p&&!vis[to.fr])
if(sz[to.fr]>num)return centroid(to.fr,v,num);
return v;
}
void go(int v,int p,int depth,int weight){
if(weight>k)return;
if(mt[k-weight].fr==timer)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...