# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1123571 | vladilius | September (APIO24_september) | C++20 | 1 ms | 580 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
int solve(int n, int m, vector<int> p, vector<vector<int>> s){
vector<int> g[n];
for (int i = 1; i < n; i++){
g[p[i]].pb(i);
}
vector<int> tin(n), tout(n), inv(n + 1);
int timer = 0;
function<void(int)> fill = [&](int v){
tin[v] = ++timer;
inv[tin[v]] = v;
for (int i: g[v]){
fill(i);
}
tout[v] = timer;
};
fill(0);
set<int> st;
for (int i = 0; i < n; i++){
st.insert(i);
}
# | 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... |
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |