# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
297231 | PeppaPig | 자매 도시 (APIO20_swap) | C++14 | 623 ms | 61876 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "swap.h"
#include <bits/stdc++.h>
#define iii tuple<int, int, int>
using namespace std;
const int N = 3e5 + 5;
int dsu[N];
int find(int x) { return dsu[x] = x == dsu[x] ? x : find(dsu[x]); }
int n, m, ptr;
int cost[N], deg[N], has_3[N], has_cycle[N], par[N][20], dep[N];
vector<int> g[N];
void onion(int a, int b) {
has_3[ptr] = has_3[find(a)] | has_3[find(b)];
has_cycle[ptr] = has_cycle[find(a)] | has_cycle[find(b)];
if(deg[a] >= 3 || deg[b] >= 3) has_3[ptr] = 1;
g[ptr].emplace_back(find(a));
if(find(a) == find(b)) has_cycle[ptr] = 1;
else g[ptr].emplace_back(find(b));
dsu[find(a)] = dsu[find(b)] = ptr;
}
# | 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... |