#include "supertrees.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int construct(std::vector<std::vector<int>> p) {
int n = p.size();
bool sub_task_1 = true;
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
if (p[i][j] != 1){
sub_task_1 = false;
}
}
}
std::vector<std::vector<int>> answer;
if (n == 1){
for (int i = 0; i < n; i++) {
std::vector<int> row;
row.resize(n);
answer.push_back(row);
}
}
else if (sub_task_1){ // p[i][j] = 1;
for (int i = 0; i < n; i++) {
std::vector<int> row;
row.resize(n);
answer.push_back(row);
}
for (int i = 0; i < n - 1; i++){
answer[i][i + 1] = 1;
answer[i + 1][i] = 1;
}
}
build(answer);
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
296 KB |
Output is correct |
6 |
Correct |
6 ms |
1244 KB |
Output is correct |
7 |
Correct |
152 ms |
24052 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
296 KB |
Output is correct |
6 |
Correct |
6 ms |
1244 KB |
Output is correct |
7 |
Correct |
152 ms |
24052 KB |
Output is correct |
8 |
Incorrect |
1 ms |
212 KB |
WA in grader: Invalid number of rows in b |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
WA in grader: Invalid number of rows in b |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
WA in grader: Invalid number of rows in b |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
296 KB |
Output is correct |
6 |
Correct |
6 ms |
1244 KB |
Output is correct |
7 |
Correct |
152 ms |
24052 KB |
Output is correct |
8 |
Incorrect |
1 ms |
212 KB |
WA in grader: Invalid number of rows in b |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
296 KB |
Output is correct |
6 |
Correct |
6 ms |
1244 KB |
Output is correct |
7 |
Correct |
152 ms |
24052 KB |
Output is correct |
8 |
Incorrect |
1 ms |
212 KB |
WA in grader: Invalid number of rows in b |
9 |
Halted |
0 ms |
0 KB |
- |