# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
593269 | 1zaid1 | Stranded Far From Home (BOI22_island) | C++17 | 196 ms | 50592 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;
#define endl '\n'
const int M = 4e5+1;
#define int long long
vector<int> node[M];
int p[M], sum[M], k[M];
vector<int> bt[M];
int find(int s) {
return (s == p[s]?s:p[s]=find(p[s]));
}
void uni(int x, int y) {
if (bt[x].size() < bt[y].size()) swap(x, y);
for (int i:bt[y]) bt[x].push_back(i);
bt[y].clear();
p[y] = x;
sum[x] += sum[y];
}
signed main() {
cin.tie(0)->sync_with_stdio(0);
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++) cin >> k[i];
for (int i = 1; i <= m; i++) {
int a, 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... |