# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
574841 | AJ00 | Connecting Supertrees (IOI20_supertrees) | C++14 | 1 ms | 340 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 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 == 0){
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;
}
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... |