# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
646449 | adrilen | Stranded Far From Home (BOI22_island) | C++17 | 130 ms | 7676 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;
typedef pair<int, int> pii;
constexpr int maxn = 2e5;
int parent[maxn] = { 0 },
isize[maxn]; // Size needed to take over that node
ll cursize[maxn]; // The size the node can use to take over other nodes
bool output[maxn] = { 0 };
struct fri {
int a, b, va, vb;
bool operator<(const fri &f) const
{
if (va != f.va) return va > f.va;
return vb > f.vb;
}
} ;
int find(const int &p)
{
if (parent[p] == p) return p;
int temp = parent[p];
parent[p] = find(parent[p]);
if (output[temp]) output[p] = true; // Marking the nodes
# | 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... |