#include "supertrees.h"
#include <vector>
using namespace std;
int construct(std::vector<std::vector<int>> p) {
int n = (int) p.size();
vector<vector<int>> building(n, vector<int> (n, 0));
for(int i=0; i<=n-2; ++i) {
for(int j=i+1; j<=n-1; ++j) {
if (p[i][j] == 0) {
continue;
}
building[i][j] = 1;
building[j][i] = 1;
break;
}
}
for(int i=0; i<=n-1; ++i) {
building[i][i] = 1;
int cnt = 0;
for(int j=0; j<=n-1; ++j) {
cnt += building[i][j];
}
if(cnt < 2) {
return 0;
}
}
build(building);
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Answer gives possible 0 while actual possible 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Answer gives possible 0 while actual possible 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Answer gives possible 0 while actual possible 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Answer gives possible 0 while actual possible 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Answer gives possible 0 while actual possible 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Answer gives possible 0 while actual possible 1 |
2 |
Halted |
0 ms |
0 KB |
- |