제출 #919109

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9191092024-01-31 10:08:10vjudge1Valley (BOI19_valley)C++17
100 / 100
128 ms57288 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define oo 1e18
#define N 100005
#define log 20
#define fi first
#define se second
typedef pair<int, int> ii;
int n, q, s, e, dep[N], ds[N], par[log + 5][N], getdp[log + 5][N], dp[N], tin[N], tout[N], tim;
vector<ii> adj[N];
ii eg[N];
void init(int u, int p){
tin[u] = ++tim;
for (auto x : adj[u]){
if (x.fi == p) continue;
dep[x.fi] = dep[u] + 1;
ds[x.fi] = ds[u] + x.se;
par[0][x.fi] = u;
init(x.fi, u);
dp[u] = min(dp[u], dp[x.fi] + x.se);
}
tout[u] = tim;
}
void init2(int u, int p){
for (auto x : adj[u]){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...