# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
892297 | votranngocvy | Valley (BOI19_valley) | C++14 | 140 ms | 61632 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;
#define int long long
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
const int N = 1e5 + 5;
const int inf = 0x3f3f3f3f3f3f3f3f;
int par[N][25],h[N],f[N],fini[N],start[N],Min[N][25],timeDFS,dp[N];
vector<pii>g[N],edge;
bool marked[N];
void dfs(int u,int p) {
par[u][0] = p;
start[u] = ++timeDFS;
for (auto x: g[u]) {
int v = x.fi,w = x.se;
if (v == p) continue;
f[v] = f[u] + w;
h[v] = h[u] + 1;
dfs(v,u);
dp[u] = min(dp[u],dp[v] + w);
}
fini[u] = timeDFS;
}
void dfs1(int u,int p) {
for (auto x: g[u]) {
# | 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... |