# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
915266 | Tuanlinh123 | Capital City (JOI20_capital_city) | C++17 | 261 ms | 221036 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 ll long long
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ld long double
using namespace std;
const ll maxn=1000005, inf=1e9;
stack <ll> st;
vector <pll> euler;
pll sp[20][maxn*2];
vector <ll> A[maxn], B[maxn];
ll c[maxn], lca[maxn], pa[maxn], r[maxn];
ll cnt, Time, num[maxn], lo[maxn], comp[maxn], sz[maxn];
void dfs(ll u)
{
lca[u]=euler.size()+1;
euler.pb({lca[u], u});
for (ll v:A[u])
{
if (v==pa[u])
continue;
pa[v]=u, dfs(v);
euler.pb({lca[u], u});
}
}
Compilation message (stderr)
# | 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... |