Submission #805306

# Submission time Handle Problem Language Result Execution time Memory
805306 2023-08-03T14:59:47 Z Hydrolyzed Connecting Supertrees (IOI20_supertrees) C++14
0 / 100
0 ms 212 KB
#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 < 1) {
			return 0;
		}
	}
	build(building);
	return 1;
}
# 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 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 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 -