# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
413055 | losmi247 | Connecting Supertrees (IOI20_supertrees) | C++14 | 263 ms | 27956 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;
typedef long long ll;
const int N = 1005;
int n;
int p[N][N];
int linija(){
vector <vector<int>> ans;
for(int i = 1; i <= n; i++){
vector <int> fg;
for(int j = 1; j <= n; j++){
if(j == i+1 || j == i-1) fg.push_back(1);
else fg.push_back(0);
}
ans.push_back(fg);
}
build(ans);
return 1;
}
int construct(vector <vector<int>> nz){
n = nz.size();
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
p[i][j] = nz[i-1][j-1];
}
}
bool prvi = 0;
for(int i = 1; i <= n; i++) for(int j = 1; j <= n; j++) prvi |= (p[i][j] != 1);
if(!prvi){
return linija();
}
}
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... |