# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1172246 | gyg | Keys (IOI21_keys) | C++20 | 1745 ms | 373460 KiB |
#include "keys.h"
#include <bits/stdc++.h>
using namespace std;
#define vec vector
#define arr array
#define pii pair<int, int>
#define fir first
#define sec second
#define hset unordered_set
#define hmap unordered_map
const int N = 3e5 + 5, INF = 1e9;
// Zero indexing
int n;
arr<int, N> cl;
arr<vec<pii>, N> adj;
struct Dsj {
arr<int, N> prnt;
void intl() {
for (int u = 0; u < n; u++)
prnt[u] = u;
}
int pr(int u) {
return (prnt[u] == u) ? u : prnt[u] = pr(prnt[u]);
}
void mrg(int u, int v) { // v into u
u = pr(u), v = pr(v);
assert(u != v);
# | 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... |