# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
684001 | thiago_bastos | 자매 도시 (APIO20_swap) | C++17 | 127 ms | 12168 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "swap.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int par[MAXN], depth[MAXN], t[MAXN], third[MAXN], deg[MAXN];
int findSet(int u) {
return u == par[u] ? u : findSet(par[u]);
}
int h(int u) {
return u == par[u] ? 0 : 1 + h(par[u]);
}
bool merge(int u, int v, int w) {
u = findSet(u);
v = findSet(v);
if(u == v) return false;
if(depth[u] > depth[v]) swap(u, v);
par[u] = v;
depth[v] += depth[u] == depth[v];
third[v] = min(third[v], third[u]);
t[u] = w;
return true;
}
# | 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... |