# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
503070 | waynetuinfor | Keys (IOI21_keys) | C++17 | 1 ms | 332 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 <algorithm>
#include <cassert>
#include <functional>
#include <iostream>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <vector>
struct UnionFind {
UnionFind(int n) : uf(n) { std::iota(uf.begin(), uf.end(), 0); }
int Find(int x) {
if (x == uf[x]) return x;
return uf[x] = Find(uf[x]);
}
void Merge(int x, int y) {
int fx = Find(x), fy = Find(y);
uf[fx] = fy;
}
std::vector<int> uf;
};
std::vector<int> find_reachable(std::vector<int> r, std::vector<int> u,
std::vector<int> v, std::vector<int> c) {
int N = r.size(), M = u.size();
std::vector<std::unordered_set<int>> keys(N + N);
std::vector<std::unordered_map<int, std::vector<int>>> out_edges(N + N);
# | 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... |