# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
393385 | juggernaut | Race (IOI11_race) | C++14 | 524 ms | 36220 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>
#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)
# | 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... |