# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
881658 | Alcabel | Cat Exercise (JOI23_ho_t4) | C++17 | 515 ms | 196948 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;
const int maxn = 5e3;
int a[maxn];
vector<int> g[maxn];
int mx[maxn][maxn], dist[maxn][maxn];
void dfsMax(int v, int p, int root) {
for (const int& u : g[v]) {
if (u != p) {
mx[root][u] = max(mx[root][v], a[u]);
dist[root][u] = dist[root][v] + 1;
dfsMax(u, v, root);
}
}
}
void solve() {
int n;
cin >> n;
vector<int> posOf(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
--a[i];
posOf[a[i]] = i;
}
for (int i = 0; i < n - 1; ++i) {
int v, u;
cin >> v >> u;
# | 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... |