# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1158560 | AlgorithmWarrior | Valley (BOI19_valley) | C++20 | 113 ms | 37128 KiB |
#include <bits/stdc++.h>
using namespace std;
int const MAX=1e5+5;
int const LOG=20;
long long const INF=1e18;
int n,nrs,q,root;
struct edge{
int nod,len;
};
struct muchie{
int a,b;
}much[MAX];
vector<edge>tree[MAX];
int ancestor[MAX][LOG];
long long dist_shop[MAX][LOG];
bool shop[MAX];
long long nearest_sub[MAX];
long long dist_rt[MAX];
int niv[MAX];
void read(){
cin>>n>>nrs>>q>>root;
int i;
for(i=1;i<n;++i){
int a,b,w;
cin>>a>>b>>w;
tree[a].push_back({b,w});
tree[b].push_back({a,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... |