# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
603429 | Sam_a17 | Connecting Supertrees (IOI20_supertrees) | C++14 | 0 ms | 0 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 "A.cpp"
#include <bits/stdc++.h>
// #include <vector>
using namespace std;
#define sz(x) (int((x).size()))
#define len(x) (int)x.length()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define dbg(x) cout << #x << " " << x << endl;
#define pb push_back
#define ld long double
#define ll long long
int construct(std::vector<std::vector<int>> p) {
int n = p.size();
bool allOne = true;
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
if(p[i][j] != allOne) {
allOne = false;
}
}
}
if(allOne) {
vector<vector<int>> answ(n, vector<int> (n, 0));
for(int i = 0; i < n - 1; i++){
answ[i][i + 1] = 1;
answ[i + 1][i] = 1;
}
build(answ);
return 1;
}
return 1;
}