# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
636612 | MohamedFaresNebili | Bridges (APIO19_bridges) | C++14 | 2193 ms | 31100 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;
const int batch = 1001;
int N, M, Q, ans[100001];;
int S[100001], P[100001];
int U[100001], V[100001], W[100001];
int T[100001], X[100001], Y[100001];
vector<int> join[batch]; stack<int> st;
bool changed[100001];
void reset() {
for(int i = 1; i <= N; i++)
P[i] = i, S[i] = 1;
}
int findSet(int a) {
if(P[a] == a) return a;
return findSet(P[a]);
}
void unionSet(int a, int b) {
a = findSet(a), b = findSet(b);
if(a == b) return;
if(S[a] > S[b]) swap(a, b);
st.push(a); S[b] += S[a];
P[a] = P[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... |