답안 #779126

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
779126 2023-07-11T08:07:49 Z Josia 슈퍼트리 잇기 (IOI20_supertrees) C++17
11 / 100
154 ms 23924 KB
#include "supertrees.h"
#include <vector>
#include <bits/stdc++.h>


using namespace std;


int construct(std::vector<std::vector<int>> p) {
	int n = p.size();
	if (n == 1) {
		if (p[0][0] == 1) {
			build({{0}});
			return 1;
		}
		return 0;
	}
	vector<vector<int>> answer(n, vector<int>(n));

	vector<int> vals;

	for (int i = 0; i<n; i++) {
		bool isZero = p[i][(i+1)%n]==0;
		for (int j = 0; j<n; j++) {
			if (j == i) continue;
			if ((p[i][j] == 0) != isZero) return 0;
		}
		if (!isZero) vals.push_back(i);
	}

	for (int i = 0; i<(int)(vals.size())-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 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 6 ms 1148 KB Output is correct
7 Correct 150 ms 21992 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 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 6 ms 1148 KB Output is correct
7 Correct 150 ms 21992 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 7 ms 1176 KB Output is correct
13 Correct 154 ms 23924 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 3 ms 824 KB Output is correct
17 Correct 65 ms 14084 KB Output is correct
18 Correct 1 ms 304 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Incorrect 16 ms 3768 KB Answer gives possible 0 while actual possible 1
21 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 Incorrect 0 ms 212 KB Answer gives possible 1 while actual possible 0
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Too few ways to get from 0 to 1, should be 2 found 1
3 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 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 6 ms 1148 KB Output is correct
7 Correct 150 ms 21992 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 7 ms 1176 KB Output is correct
13 Correct 154 ms 23924 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 3 ms 824 KB Output is correct
17 Correct 65 ms 14084 KB Output is correct
18 Correct 1 ms 304 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Incorrect 16 ms 3768 KB Answer gives possible 0 while actual possible 1
21 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 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 6 ms 1148 KB Output is correct
7 Correct 150 ms 21992 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 7 ms 1176 KB Output is correct
13 Correct 154 ms 23924 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 3 ms 824 KB Output is correct
17 Correct 65 ms 14084 KB Output is correct
18 Correct 1 ms 304 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Incorrect 16 ms 3768 KB Answer gives possible 0 while actual possible 1
21 Halted 0 ms 0 KB -