Submission #447646

# Submission time Handle Problem Language Result Execution time Memory
447646 2021-07-27T08:09:59 Z EliteCallsYou Connecting Supertrees (IOI20_supertrees) C++17
21 / 100
844 ms 24124 KB
#include "supertrees.h"
#include <bits/stdc++.h>
using namespace std ;
 
int construct(std::vector<std::vector<int>> p) {
	int n = (int)p.size();
	std::vector<std::vector<int>> answer;
	for (int i = 0; i < n ; i++ ) {
		std::vector<int> row;
		row.resize(n);
		for ( int j = 0 ; j < n ; j ++ ){
			if ( p[i][j] ){
				if ( i == j ){ row[j] = 0 ; continue ; }
				bool found = false ;
				for ( int l = 0 ; l < min(i,j) ; l ++ ){
					if ( p[i][l] && p[j][l] && l != i && l != j ){
						found = true ;
						break ;
					}
				}
				if ( !found ){ row[j] = 1 ; }
			}
			else{
				for ( int l = 0 ; l < j ; l ++ ){
					if ( p[i][l] && p[l][j] ){
						return 0;
					}
				}
			}
		}
		answer.push_back(row);
	}
	build(answer);
	return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 10 ms 1228 KB Output is correct
7 Correct 240 ms 23936 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 10 ms 1228 KB Output is correct
7 Correct 240 ms 23936 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 13 ms 1228 KB Output is correct
13 Correct 550 ms 23988 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Correct 4 ms 688 KB Output is correct
17 Correct 102 ms 10100 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 1 ms 288 KB Output is correct
20 Correct 112 ms 6252 KB Output is correct
21 Correct 844 ms 23908 KB Output is correct
22 Correct 564 ms 24056 KB Output is correct
23 Correct 703 ms 24124 KB Output is correct
24 Correct 533 ms 24036 KB Output is correct
25 Correct 97 ms 10088 KB Output is correct
26 Correct 205 ms 11244 KB Output is correct
27 Correct 726 ms 23956 KB Output is correct
28 Correct 534 ms 23888 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Incorrect 0 ms 204 KB Answer gives possible 1 while actual possible 0
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Too few ways to get from 0 to 1, should be 2 found 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 10 ms 1228 KB Output is correct
7 Correct 240 ms 23936 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 13 ms 1228 KB Output is correct
13 Correct 550 ms 23988 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Correct 4 ms 688 KB Output is correct
17 Correct 102 ms 10100 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 1 ms 288 KB Output is correct
20 Correct 112 ms 6252 KB Output is correct
21 Correct 844 ms 23908 KB Output is correct
22 Correct 564 ms 24056 KB Output is correct
23 Correct 703 ms 24124 KB Output is correct
24 Correct 533 ms 24036 KB Output is correct
25 Correct 97 ms 10088 KB Output is correct
26 Correct 205 ms 11244 KB Output is correct
27 Correct 726 ms 23956 KB Output is correct
28 Correct 534 ms 23888 KB Output is correct
29 Correct 0 ms 204 KB Output is correct
30 Correct 0 ms 204 KB Output is correct
31 Correct 0 ms 204 KB Output is correct
32 Incorrect 0 ms 204 KB Answer gives possible 1 while actual possible 0
33 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 10 ms 1228 KB Output is correct
7 Correct 240 ms 23936 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 13 ms 1228 KB Output is correct
13 Correct 550 ms 23988 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Correct 4 ms 688 KB Output is correct
17 Correct 102 ms 10100 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 1 ms 288 KB Output is correct
20 Correct 112 ms 6252 KB Output is correct
21 Correct 844 ms 23908 KB Output is correct
22 Correct 564 ms 24056 KB Output is correct
23 Correct 703 ms 24124 KB Output is correct
24 Correct 533 ms 24036 KB Output is correct
25 Correct 97 ms 10088 KB Output is correct
26 Correct 205 ms 11244 KB Output is correct
27 Correct 726 ms 23956 KB Output is correct
28 Correct 534 ms 23888 KB Output is correct
29 Correct 0 ms 204 KB Output is correct
30 Correct 0 ms 204 KB Output is correct
31 Correct 0 ms 204 KB Output is correct
32 Incorrect 0 ms 204 KB Answer gives possible 1 while actual possible 0
33 Halted 0 ms 0 KB -