# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
574821 | AJ00 | 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 <bits/stdc++.h>
using namespace std;
int n;
const int MOD = 1000000007;
const int INF = 1e18;
int construct (vector<vector<int>> p){
int n = p.size();
vector<vector<int>> b(n,vector<int>(n,0));
if (n == 1){
build(b);
return 1;
}
for (int i = 0; i < n; i++){
if (!i){
b[i][1] = 1;
}
if (i == n-1){
b[i][n-2] = 1;
}
else {
b[i][i-1] = 1;
b[i][i+1] = 1;
}
}
build(b);
return 1;
}