# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
226503 | mohamedsobhi777 | Race (IOI11_race) | C++14 | 2357 ms | 129404 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>
using namespace std ;
const int NN = 1e6 + 7 ;
long long n , k ;
long long ans = 10000000000000 ;
vector<pair<long long , long long > > adj[NN] ;
long long hei[NN] , ldr[NN] , sz[NN];
long long fr[NN] , ls[NN] , ver[NN];
map<long long , map<long long , long long > > anss ;
int t = 1;
int dfz(int x , int p , long long h, int l = 1 ){
ver[t] = x ;
fr[x] = t++ ;
int ret = 1;
hei[x] = h ;
ldr[x] = l ;
for(auto u : adj[x]){
if(u.first==p)continue ;
ret+=dfz(u .first, x , h + u.second , l+1 ) ;
}
ls[x] = t++ ;
return sz[x] = ret ;
}
int dfs(int x , int p , bool keep){
int big = 0 ;
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... |