# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
567448 | _karan_gandhi | Valley (BOI19_valley) | C++17 | 134 ms | 18756 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 all(v) v.begin(), v.end()
#define endl '\n'
#define pl(var) " [" << #var << ": " << (var) << "] "
#define ll long long
vector<vector<pair<int, int>>> adj;
vector<int> tin, tout;
vector<ll int> dist, dp1, dp2;
vector<bool> shop;
int timer = 0;
void dfs(int u, int par, ll int dis) {
dist[u] = dis;
tin[u] = timer++;
for (auto [v, w] : adj[u]) {
if (v == par) continue;
dfs(v, u, dis + w);
}
if (shop[u]) dp1[u] = 0;
else dp1[u] = 1e16;
for (auto [v, _] : adj[u]) {
if (v == par) continue;
# | 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... |