# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1150266 | abczz | Bridges (APIO19_bridges) | C++20 | 3065 ms | 449964 KiB |
#include <iostream>
#include <array>
#include <algorithm>
#include <cmath>
#define ll int
using namespace std;
array<ll, 3> A[100005];
vector <array<ll, 4>> Q;
vector <array<ll, 4>> T;
vector <ll> U[100005];
ll n, m, q, a, b, c, t, rtq, P[100005], F[100005];
struct DSU{
vector <ll> G, gsz;
void init(ll sz) {
G.resize(sz);
gsz.resize(sz);
for (int i=0; i<sz; ++i) G[i] = i, gsz[i] = 1;
}
ll dsu(ll u) {
if (G[u] == u) return u;
else return dsu(G[u]);
}
ll dsu_fast(ll u) {
if (G[u] == u) return u;
else return G[u] = dsu(G[u]);
}
ll query(ll u) {
return gsz[dsu(u)];
# | 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... |