# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
26583 | model_code | Amusement Park (JOI17_amusement_park) | C++14 | 89 ms | 23480 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 "Joi.h"
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
static const int NMAX = 10000;
static const int BITS = 60;
namespace {
vector<int> tree[NMAX];
int N;
int union_find[NMAX];
int root(int p)
{
return union_find[p] < 0 ? p : (union_find[p] = root(union_find[p]));
}
bool join(int p, int q)
{
p = root(p);
q = root(q);
if (p == q) return false;
union_find[p] += union_find[q];
union_find[q] = p;
return true;
}
void SpanningTree(int M, int A[], int B[]) {
fill(union_find, union_find + N, -1);
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... |