# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
538035 | fhvirus | Long Mansion (JOI17_long_mansion) | C++17 | 320 ms | 47336 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.
// rama_pang orz
// solution and codestyle adapted from his/her submission
#include<bits/stdc++.h>
using namespace std;
struct DisjointSet {
int n;
vector<int> f;
DisjointSet () = default;
DisjointSet (const int& _n): n(_n), f(n) { iota(begin(f), end(f), 0); }
int F(int u) { return u == f[u] ? u : f[u] = F(f[u]); }
bool M(int u, int v) {
u = F(u); v = F(v);
if (u != v) f[v] = u;
return u != v;
}
};
const int kN = 500005;
int N, Q, C[kN];
vector<int> key_pos[kN];
bool can_unlock(int l, int r, int c) {
return *lower_bound(begin(key_pos[c]), end(key_pos[c]), l) <= r;
}
pair<int, int> memo[kN];
bool in_stack[kN];
DisjointSet dsu(kN);
# | 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... |