# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
673025 | JooDdae | Bridges (APIO19_bridges) | C++17 | 3083 ms | 4844 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>
using namespace std;
using ll = long long;
int n, m, q, p[50050], sz[50050], ans[100100];
bool chk[100100], chk2[100100];
stack<array<int, 2>> st;
int find(int a) {
if(a == p[a]) return a;
return find(p[a]);
}
bool merge(int a, int b) {
// cout << a << "+" << b << "\n";
a = find(a), b = find(b);
if(a == b) return false;
if(sz[a] < sz[b]) swap(a, b);
p[b] = a, sz[a] += sz[b];
st.push({a, b});
return true;
}
int main(){
cin.tie(0)->sync_with_stdio(0);
cin >> n >> m;
vector<array<int, 3>> E(m);
for(auto &[z, x, y] : E) cin >> x >> y >> z;
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... |