# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
216716 | DS007 | Game (IOI14_game) | C++14 | 5 ms | 384 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;
class DSU {
int *par, *val;
int n, count;
public:
DSU(int n) {
this->n = n;
count = 0;
par = new int[n];
val = new int[n];
iota(par, par + n, 0);
fill(val, val + n, n - 1);
}
int find(int v) {
if (v == par[v])
return v;
else
return par[v] = find(par[v]);
}
int merge(int a, int b) {
int pa = find(a), pb = find(b);
if (pa == pb)
return 0;
par[pa] = pb;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |