# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
776788 | ymm | Collapse (JOI18_collapse) | C++17 | 1202 ms | 23200 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 "collapse.h"
#include <bits/stdc++.h>
#define Loop(x, l, r) for (ll x = (l); x < (r); ++x)
typedef long long ll;
typedef std::pair<int,int> pii;
using namespace std;
const int N = 100'010;
namespace dsu {
int par[N];
int sz[N];
vector<pii> his;
int cnt;
bool rec;
void init() {
fill(par, par+N, -1);
fill(sz, sz+N, 1);
his.clear();
cnt = 0;
rec = 0;
}
int rt(int v) { return par[v] == -1? v: rt(par[v]); }
void unite(int v, int u) {
v = rt(v);
u = rt(u);
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... |