# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
818203 | jophyyjh | Fountain Parks (IOI21_parks) | C++17 | 1094 ms | 73052 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.
/**
* (Just a test)
*
* Time Complexity: O(n * log(n)) (Kruskal, bipartite graph, BFS, implementation)
* Implementation 0.9 (test)
*/
#include <bits/stdc++.h>
#include "parks.h"
typedef std::vector<int> vec;
struct DSU {
vec set, rank;
DSU(int n) {
set.resize(n);
rank.resize(n);
for (int k = 0; k < n; k++)
set[k] = k, rank[k] = 1;
}
inline int find(int k) {
if (set[k] == k)
return k;
return set[k] = find(set[k]);
}
bool merge(int a, int b) {
a = find(a), b = find(b);
if (a == b)
return false;
if (rank[b] > rank[a])
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |