Submission #817788

# Submission time Handle Problem Language Result Execution time Memory
817788 2023-08-09T16:14:51 Z OrazB Connecting Supertrees (IOI20_supertrees) C++14
21 / 100
171 ms 23984 KB
#include <bits/stdc++.h>
#include "supertrees.h"
using namespace std;
#define all(x) (x).begin(), (x).end()
#define ll long long int
#define pii pair <int, int>
#define pb push_back
#define ff first
#define ss second

const int N = 1e5+5;
int tp[N];

int construct(vector<vector<int>> p){
	int n = p.size();
	vector<vector<int>> b(n, vector<int>(n));
	for (int i = 0; i < n; i++){
		if (tp[i]){
			if (p[tp[i]-1] != p[i]) return 0;
			continue;
		}
		for (int j = 0; j < n; j++){
			if (i == j) continue;
			if (p[i][j]){
				tp[j] = i+1;
				b[i][j] = b[j][i] = 1;
			}
		}
	}
	build(b);
	return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 6 ms 1212 KB Output is correct
7 Correct 146 ms 23984 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 6 ms 1212 KB Output is correct
7 Correct 146 ms 23984 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 6 ms 1216 KB Output is correct
13 Correct 163 ms 23932 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 308 KB Output is correct
16 Correct 4 ms 808 KB Output is correct
17 Correct 65 ms 14092 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 40 ms 6208 KB Output is correct
21 Correct 148 ms 23952 KB Output is correct
22 Correct 171 ms 23888 KB Output is correct
23 Correct 151 ms 23964 KB Output is correct
24 Correct 153 ms 23936 KB Output is correct
25 Correct 62 ms 14076 KB Output is correct
26 Correct 62 ms 14072 KB Output is correct
27 Correct 171 ms 23924 KB Output is correct
28 Correct 152 ms 23980 KB Output is correct
# Verdict Execution time Memory 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 1 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB Answer gives possible 0 while actual possible 1
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Answer gives possible 0 while actual possible 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 6 ms 1212 KB Output is correct
7 Correct 146 ms 23984 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 6 ms 1216 KB Output is correct
13 Correct 163 ms 23932 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 308 KB Output is correct
16 Correct 4 ms 808 KB Output is correct
17 Correct 65 ms 14092 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 40 ms 6208 KB Output is correct
21 Correct 148 ms 23952 KB Output is correct
22 Correct 171 ms 23888 KB Output is correct
23 Correct 151 ms 23964 KB Output is correct
24 Correct 153 ms 23936 KB Output is correct
25 Correct 62 ms 14076 KB Output is correct
26 Correct 62 ms 14072 KB Output is correct
27 Correct 171 ms 23924 KB Output is correct
28 Correct 152 ms 23980 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Incorrect 1 ms 212 KB Answer gives possible 0 while actual possible 1
34 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 6 ms 1212 KB Output is correct
7 Correct 146 ms 23984 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 6 ms 1216 KB Output is correct
13 Correct 163 ms 23932 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 308 KB Output is correct
16 Correct 4 ms 808 KB Output is correct
17 Correct 65 ms 14092 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 40 ms 6208 KB Output is correct
21 Correct 148 ms 23952 KB Output is correct
22 Correct 171 ms 23888 KB Output is correct
23 Correct 151 ms 23964 KB Output is correct
24 Correct 153 ms 23936 KB Output is correct
25 Correct 62 ms 14076 KB Output is correct
26 Correct 62 ms 14072 KB Output is correct
27 Correct 171 ms 23924 KB Output is correct
28 Correct 152 ms 23980 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Incorrect 1 ms 212 KB Answer gives possible 0 while actual possible 1
34 Halted 0 ms 0 KB -