# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
497062 | deinfreund | Valley (BOI19_valley) | C++17 | 419 ms | 81208 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 int int64_t
using namespace std;
vector<vector<pair<int, int>>>graph;
vector<vector<int>>up, val;
vector<int>tin, tout, dist, lvl, shh, shop;
int timer = 0;
int l = 32;
int min(int a, int b){
if(a < b) return a;
return b;
}
void dfs(int v, int p){
tin[v] = timer++;
up[v][0] = p;
if(shop[v]) shh[v] = 0;
for(int i = 1; i<=l; ++i){
up[v][i] = up[up[v][i-1]][i-1];
}
for(auto [u, w]: graph[v]){
if(u != p){
lvl[u] = lvl[v] + 1;
dist[u] = dist[v] + w;
# | 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... |