#include "supertrees.h"
#include <vector>
int construct(std::vector<std::vector<int>> p) {
int n = p.size();
std::vector<std::vector<int>> a;
for (int i = 0; i < n; i++) {
std::vector<int> row;
row.resize(n);
a.push_back(row);
}
for(int i = 0; i < n; i ++)
{
int oka = -1;
for(int j = 0; j < n; j ++)
{
if(p[i][j])
{
oka = j;
break;
}
}
if(~oka)
{
a[i][oka] = a[oka][i] = 1;
}
}
build(a);
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
b[0][0] is not 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
b[0][0] is not 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
b[0][0] is not 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
b[0][0] is not 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
b[0][0] is not 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
b[0][0] is not 0 |
2 |
Halted |
0 ms |
0 KB |
- |