# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
700208 | mnbvcxz123 | Race (IOI11_race) | C++17 | 942 ms | 41872 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>
using namespace std;
using ll=long long;
using ar=array<ll,2>;
ll n,k,res=1e7;
vector<ar>g[200000];
ll sz[200000];
bool used[200000];
map<ll,ll>mp;
void siz(ll v, ll e){
sz[v]=1;
for(const auto&[i,w]:g[v])
if(i!=e and !used[i]) siz(i,v),sz[v]+=sz[i];
}
ll get(ll v, ll e, ll des){
for(const auto&[i,w]:g[v])
if(i!=e and !used[i] and sz[i]>des) return get(i,v,des);
return v;
}
void help(ll v, ll e, ll km, ll d, bool fill){
if(km>k) return;
if(fill){
if(!mp.count(km)) mp[km]=d;
else mp[km]=min(mp[km],d);
}
else{
if(km==k) res=min(res,d);
else if(mp.count(k-km)) res=min(res,d+mp[k-km]);
}
for(const auto&[i,w]:g[v])
# | 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... |