# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
125549 | The_Wolfpack | Valley (BOI19_valley) | C++14 | 505 ms | 48376 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>
#define pii pair<int,int>
#define x first
#define y second
#define ll long long
using namespace std;
const int NMAX=1e5+7;
const int LogNMAX=25;
const ll INF=1e18;
int n,s,q,E,tin[NMAX],tout[NMAX],par[LogNMAX][NMAX],lvl[NMAX];
vector<pii> g[NMAX];
ll dp[NMAX], dep[NMAX], mn[LogNMAX][NMAX];
struct edge{int a,b,w;};
edge e[NMAX];
int Time=0;
void Dfs(int son, int p, ll D)
{
tin[son]=++Time;
par[0][son]=p;
dep[son]=D;
for(pii i:g[son])
{
if(i.x==p) continue;
lvl[i.x]=lvl[son]+1;
Dfs(i.x, son, D+1LL*i.y);
dp[son]=min(dp[son],dp[i.x]+1LL*i.y);
# | 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... |