# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1150571 | windowwife | Bridges (APIO19_bridges) | C++20 | 755 ms | 7376 KiB |
#include <bits/stdc++.h>
#define ll long long
#define task ""
using namespace std;
const int maxn = 1e5 + 2, blocksize = 320, mod = 998244353;
int n, m, q, u[maxn], v[maxn], w[maxn], id[maxn], t[maxn], x[maxn], y[maxn], ans[maxn];
bool changed[maxn], visited[maxn];
vector<int> unchanged, updates, query, good[blocksize], adj[maxn], vv;
struct DSU
{
vector<int> par;
void init (int n)
{
par.resize(n + 1, -1);
}
void reset ()
{
fill(par.begin(), par.end(), -1);
}
int find_set (int u)
{
if (par[u] < 0) return u;
return (par[u] = find_set(par[u]));
}
void union_set (int u, int v)
{
int pu = find_set(u), pv = find_set(v);
if (pu == pv) return;
if (par[pu] > par[pv]) swap(pu, pv);
par[pu] += par[pv];
# | 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... |