Submission #447361

# Submission time Handle Problem Language Result Execution time Memory
447361 2021-07-26T07:11:57 Z EliteCallsYou Connecting Supertrees (IOI20_supertrees) C++17
21 / 100
827 ms 24108 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 0 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 1100 KB Output is correct
7 Correct 233 ms 21928 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 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 10 ms 1100 KB Output is correct
7 Correct 233 ms 21928 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 13 ms 1100 KB Output is correct
13 Correct 530 ms 22052 KB Output is correct
14 Correct 0 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Correct 5 ms 588 KB Output is correct
17 Correct 100 ms 8172 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 107 ms 5748 KB Output is correct
21 Correct 827 ms 23992 KB Output is correct
22 Correct 524 ms 23964 KB Output is correct
23 Correct 673 ms 24032 KB Output is correct
24 Correct 527 ms 23996 KB Output is correct
25 Correct 100 ms 10092 KB Output is correct
26 Correct 184 ms 11256 KB Output is correct
27 Correct 666 ms 24108 KB Output is correct
28 Correct 532 ms 24004 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 1 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 1 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 0 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 1100 KB Output is correct
7 Correct 233 ms 21928 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 13 ms 1100 KB Output is correct
13 Correct 530 ms 22052 KB Output is correct
14 Correct 0 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Correct 5 ms 588 KB Output is correct
17 Correct 100 ms 8172 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 107 ms 5748 KB Output is correct
21 Correct 827 ms 23992 KB Output is correct
22 Correct 524 ms 23964 KB Output is correct
23 Correct 673 ms 24032 KB Output is correct
24 Correct 527 ms 23996 KB Output is correct
25 Correct 100 ms 10092 KB Output is correct
26 Correct 184 ms 11256 KB Output is correct
27 Correct 666 ms 24108 KB Output is correct
28 Correct 532 ms 24004 KB Output is correct
29 Correct 0 ms 204 KB Output is correct
30 Correct 0 ms 204 KB Output is correct
31 Correct 1 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 0 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 1100 KB Output is correct
7 Correct 233 ms 21928 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 13 ms 1100 KB Output is correct
13 Correct 530 ms 22052 KB Output is correct
14 Correct 0 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Correct 5 ms 588 KB Output is correct
17 Correct 100 ms 8172 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 107 ms 5748 KB Output is correct
21 Correct 827 ms 23992 KB Output is correct
22 Correct 524 ms 23964 KB Output is correct
23 Correct 673 ms 24032 KB Output is correct
24 Correct 527 ms 23996 KB Output is correct
25 Correct 100 ms 10092 KB Output is correct
26 Correct 184 ms 11256 KB Output is correct
27 Correct 666 ms 24108 KB Output is correct
28 Correct 532 ms 24004 KB Output is correct
29 Correct 0 ms 204 KB Output is correct
30 Correct 0 ms 204 KB Output is correct
31 Correct 1 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 -