# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1085296 | an22inkle | Connecting Supertrees (IOI20_supertrees) | C++17 | 143 ms | 24400 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<bits/stdc++.h>
#include "supertrees.h"
using pair = std::array<int, 2>;
using ll = long long;
void adjlist(std::vector<std::vector<int>> p) {
int n = p.size();
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (p[i][j]) std::cout << i << ' ' << j << '\n';
}
}
std::cout << '\n';
}
int construct(std::vector<std::vector<int>> p) {
int n = p.size();
std::vector<std::vector<int>> ans(n, std::vector<int>(n)), groups;
std::vector<int> part(n, -1);
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i == j || p[i][j] == 0) continue;
if (part[i] > -1 && part[j] > -1) {
if (part[i] != part[j]) return 0;
continue;
}
if (part[i] > -1) groups[part[i]].push_back(j), part[j] = part[i];
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |