# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
393625 | Jairf__Rahman | Bridges (APIO19_bridges) | C++17 | 2458 ms | 32232 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 FOR(i, x, y) for (int i = x; i < y; i++)
typedef long long ll;
using namespace std;
const int B = 1000;
int n, m, q;
stack<int> stck;
int sz[100001], cmp[100001];
void reset() {
iota(cmp + 1, cmp + 1 + n, 1);
fill(sz + 1, sz + n + 1, 1);
}
inline int find(int a) {
while (cmp[a] != a) a = cmp[a];
return a;
}
void onion(int a, int b) {
a = find(a), b = find(b);
if (a == b) return;
if (sz[a] > sz[b]) swap(a, b);
stck.push(a);
sz[b] += sz[a];
cmp[a] = cmp[b];
}
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... |