# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
732232 | 42kangaroo | Stranded Far From Home (BOI22_island) | C++17 | 222 ms | 30300 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.
//
// Created by 42kangaroo on 16/04/2023.
//
#include "bits/stdc++.h"
using namespace std;
#define int long long
using g_t = vector<vector<int>>;
int find(int a, vector<int>& p, vector<bool>& pos) {
if (a == p[a]) return a;
int par = find(p[a], p, pos);
if (!pos[p[a]]) pos[a] = false;
return p[a] = par;
}
void unite(int a, int b, vector<int>& p, vector<int>& s, vector<bool>& pos) {
a = find(a, p, pos);
b = find(b, p, pos);
if (a == b) return;
p[b] = a;
s[a] += s[b];
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
# | 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... |