Submission #301748

# Submission time Handle Problem Language Result Execution time Memory
301748 2020-09-18T07:23:42 Z SOIVIEONE Connecting Supertrees (IOI20_supertrees) C++14
0 / 100
1 ms 384 KB
#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 -