# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
733429 | speedyArda | Stranded Far From Home (BOI22_island) | C++14 | 343 ms | 22084 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;
const int MAXN = 2e5+5;
ll in[MAXN], sum[MAXN];
int par[MAXN];
bool marked[MAXN];
int find(int v)
{
int curr_par = v;
while(curr_par != par[curr_par])
{
if(marked[curr_par])
marked[v] = true;
curr_par = par[curr_par];
}
return curr_par;
}
void merge(int a, int b)
{
a = find(a), b = find(b);
if(a == b)
return ;
if(sum[a] < sum[b])
swap(a, b);
sum[a] += sum[b];
# | 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... |