# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
861684 | faustaadp | Soccer Stadium (IOI23_soccer) | 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 "closing.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#include <vector>
const ll NN = 2e5 + 5;
vector<pll> v[NN];
ll isi[NN], py[NN], te, ps[NN];
vector<ll> isi2;
void dfs(ll pos, ll par, ll now)
{
te++;
isi[te] = pos;
py[pos] = te;
ps[te] = now;
for(auto nx : v[pos])
{
if(nx.fi != par)
dfs(nx.fi, pos, now + nx.se);
}
}
void dfs2(ll pos, ll par, ll now)
{
isi2.pb(now);
for(auto nx : v[pos])