# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
123013 | model_code | Valley (BOI19_valley) | C++17 | 807 ms | 43140 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 <vector>
using namespace std;
typedef long long ll;
const int maxn = 200005;
const int maxlg = 20;
const ll inf = 1LL << 60;
vector<pair<int, ll>> adj [maxn];
ll height [maxn];
int lvl [maxn];
ll dp [maxn];
bool store [maxn];
int start_time [maxn];
int end_time [maxn];
int cur_time;
void build_dp (int vertex, int parent, ll cur_height) {
cur_time++;
start_time[vertex] = cur_time;
height[vertex] = cur_height;
lvl[vertex] = lvl[parent] + 1;
for (pair<int, ll> nxt : adj[vertex]) {
if (nxt.first != parent) {
build_dp(nxt.first, vertex, cur_height + nxt.second);
}
# | 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... |