# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
134900 | Bodo171 | Valley (BOI19_valley) | C++14 | 599 ms | 43640 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 <iostream>
#include <fstream>
#include <vector>
using namespace std;
const int nmax=100005;
const long long inf=1LL*1e15;
vector< pair<int,int> > v[nmax];
vector<int> label[nmax];
long long lev[nmax],closest[nmax];
long long mn[20][nmax];
long long ans;
int tt[20][nmax];
int l[nmax],r[nmax],dpth[nmax],actual[nmax];
int nr,n,spec,q,root,i,x,y,z,j,blocat,nod,cat;
void dfs(int x)
{
int nod=0;
l[x]=++nr;
for(int i=0;i<v[x].size();i++)
if(!l[v[x][i].first])
{
nod=v[x][i].first;
tt[0][nod]=x;dpth[nod]=dpth[x]+1;
actual[label[x][i]]=nod;
lev[nod]=1LL*lev[x]+v[x][i].second;
dfs(nod);
closest[x]=min(closest[x],closest[nod]+v[x][i].second);
}
r[x]=nr;
}
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... |