# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
59736 | model_code | Min-max tree (BOI18_minmaxtree) | C++17 | 224 ms | 17548 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int NMAX = 100000 + 5;
int N;
vector <int> tree[NMAX];
int fathers[NMAX], h[NMAX];
void dfs(int node) {
for (auto it: tree[node])
if (it != fathers[node]) {
h[it] = 1 + h[node], fathers[it] = node;
dfs(it);
}
}
int father[NMAX], lowest[NMAX];
inline void init() {
for (int i = 1; i <= N; ++ i)
father[i] = lowest[i] = i;
}
inline int find(int node) {
if (father[father[node]] != father[node])
father[node] = find(father[node]);
return father[node];
}
inline void unite(int a, int b) {
a = find(a), b = find(b);
if (a == b)
# | 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... |