# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1070334 | vjudge1 | Bridges (APIO19_bridges) | C++17 | 1703 ms | 12424 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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int u[100005], v[100005], x[100005], y[100005], dd[100005], res[100005];
int p[50005], s[50005], ll = 1000;
vector<pair<int, int>> vv;
struct QUERY {
int w, x, y, num;
} b[100005];
int Find(int x) {
if (x == p[x]) return x;
return Find(p[x]);
}
void Merge(int x, int y, int flag) {
x = Find(x);
y = Find(y);
if (x == y) return;
if (s[x] < s[y]) swap(x, y);
s[x] += s[y];
p[y] = x;
if (flag == 1) vv.push_back({x, y});
}
void roll() {
int x = vv.back().first, y = vv.back().second;
vv.pop_back();
p[y] = y;
s[x] -= s[y];
}
bool cmp(QUERY aa, QUERY bb) {
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... |