# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
385512 | LucaDantas | 시간이 돈 (balkan11_timeismoney) | C++17 | 553 ms | 748 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
constexpr int maxn = 210, maxm = 1e4+10;
int n, m;
struct DSU
{
int pai[maxn], peso[maxn];
bool get_ans = 0;
void init() { for(int i = 0; i <= n; i++) pai[i] = i, peso[i] = 1; }
int find(int x) { return pai[x]==x?x:pai[x]=find(pai[x]); }
bool join(int a, int b) {
int x = a, y = b;
a = find(a), b = find(b);
if(a == b) return 0;
if(peso[a] < peso[b])
swap(a, b);
pai[b] = a;
peso[a] += peso[b];
if(get_ans) printf("%d %d\n", x, y);
return 1;
}
} dsu;
struct Edge
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |