# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
547578 | Jomnoi | Valley (BOI19_valley) | C++17 | 337 ms | 29688 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 DEBUG 0
using namespace std;
const int MAX_N = 1e5 + 10;
const long long INF = 1e18 + 7;
int A[MAX_N], B[MAX_N], W[MAX_N];
vector <pair <int, int>> graph[MAX_N];
long long dist[MAX_N];
// Heavy Light Decomposition
int timer;
int sz[MAX_N], depth[MAX_N], parent[MAX_N][20];
int head[MAX_N], st[MAX_N], pos[MAX_N];
// Segment Tree
long long tree[4 * MAX_N];
int get_size(const int &u, const int &p) {
sz[u] = 1;
for(int i = 1; i < 20; i++) {
parent[u][i] = parent[parent[u][i - 1]][i - 1];
}
for(auto [v, w] : graph[u]) {
if(v == p) {
continue;
}
depth[v] = depth[u] + 1;
# | 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... |