# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
202642 | dennisstar | Bridges (APIO19_bridges) | C++17 | 3057 ms | 16176 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>
#define fi first
#define se second
#define em emplace
#define eb emplace_back
#define all(V) (V).begin(), (V).end()
using namespace std;
typedef vector<int> vim;
typedef pair<int, int> pii;
const int B = 800;
struct line {
int u, v, r;
line(int U, int V, int R) : u(U), v(V), r(R) {}
};
typedef shared_ptr<vector<line> > pvii;
struct UF {
vim par, rnk, sz, cp; vector<pii> cr;
UF(int n) : par(n+1, 0), rnk(n+1, 0), sz(n+1, 1) {}
int get(int x) { return par[x]?get(par[x]):x; }
bool Union(int x, int y) {
x=get(x), y=get(y);
if (x==y) return false;
if (rnk[x]<rnk[y]) swap(x, y);
cp.eb(y); cr.eb(x, rnk[x]);
par[y]=x; rnk[x]=max(rnk[x], rnk[y]+1); sz[x]+=sz[y];
return true;
}
Compilation message (stderr)
# | 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... |