# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
423262 | Kerim | Unique Cities (JOI19_ho_t5) | C++17 | 574 ms | 55564 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 N = 200000;
int color[N], depth[N];
vector<int> adj[N];
void dfs_depth(int u, int p = -1) {
for (auto c : adj[u]) {
if (c != p) {
depth[c] = depth[u] + 1;
dfs_depth(c, u);
}
}
}
int height[N];
void dfs_height(int u, int p = -1) {
height[u] = 0;
for (auto c : adj[u]) {
if (c != p) {
dfs_height(c, u);
height[u] = max(height[u], height[c] + 1);
}
}
}
int tally[N], ans[N], k;
# | 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... |