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 "supertrees.h"
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e3 + 3;
int construct(std::vector<std::vector<int>> p) {
int n = p.size();
vector<vector<int>> result(n);
fill(result.begin(), result.end(), vector<int>(n));
if (n == 1) {
build(result);
return 1;
}
result[0][1] = 1;
result[n-1][n-2] = 1;
for (int i = 1; i < n-1; i++) {
result[i][i-1] = 1;
result[i][i+1] = 1;
}
build(result);
return 1;
}
// subtask 1
// answer is always a spanning tree
// or just a path lol
// just connect adjacent nodes
# | 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... |