# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
578209 | IvanJ | Stranded Far From Home (BOI22_island) | C++17 | 183 ms | 25508 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>
#define pb push_back
#define x first
#define y second
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
const int maxn = 2e5 + 5;
int n, m, P;
ll S[maxn];
int par[maxn];
ll M[maxn];
vector<int> W[maxn];
vector<pair<pair<ll, ll>, ii>> E;
int ans[maxn];
int find(int x) {return (par[x] == x) ? x : par[x] = find(par[x]);}
void merge(int x, int y) {
x = find(x), y = find(y);
if(x == y) return;
if(W[x].size() < W[y].size())
swap(x, y);
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... |