# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
544629 | pokmui9909 | Dreaming (IOI13_dreaming) | C++17 | 0 ms | 0 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>
using namespace std;
using ll = long long;
ll N, M, L;
vector<pair<ll, ll>> G[100005];
ll V1[100005];
ll D = 0, E = 0;
pair<ll, ll> Dia[100005];
ll ans = 0;
pair<ll, ll> path[100005];
void dfs1(ll n, ll p, ll k){
V1[n] = 1;
if(D < k){
D = k;
E = n;
}
for(auto i : G[n]){
ll nx = i.first, c = i.second;
if(nx == p) continue;
dfs1(nx, n, k + c);
}
}
void dfs2(ll n, ll p, ll d){
if(n == d) return;
for(auto i : G[n]){
ll nx = i.first, c = i.second;
if(nx == p) continue;
path[nx] = {n, c};
dfs2(nx, n, d);
}
}
ll R[100005];
ll sum = 1e18;
ll cost = 0;
void track(ll n, ll s, ll i){
if(n == s) return;
ll nx = path[n].first, c = path[n].second;
sum = min(sum, max(R[i] - cost, cost));
cost += c;
track(nx, s, i);
}
int travelTime(int n, int m, int l, int A[], int B[], int T[]){
return 0;
}