답안 #1115853

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1115853 2024-11-21T02:48:39 Z BuzzyBeez Political Development (BOI17_politicaldevelopment) C++17
54 / 100
3000 ms 322248 KB
#include <bits/stdc++.h>
using namespace std;

bitset<50001> G[50001], cur, all;
vector<vector<int>> C[11];

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, k, sz, u, v; cin >> n >> k;
	for (int i = 0; i < n; ++i) C[1].push_back({i}), G[i][i] = 1, all[i] = 1;
	for (u = 0; u < n; ++u) {
		cin >> sz;
		while (sz--) cin >> v, G[u][v] = 1;
	}
	vector<int> tmp;
	for (sz = 2; sz <= k; ++sz) {
		for (auto small_clique : C[sz - 1]) {
			cur = all;
			for (int i : small_clique) cur &= G[i];
			for (int j = small_clique.back() + 1; j < n; ++j) if (cur[j]) {
				tmp = small_clique; tmp.push_back(j);
				C[sz].push_back(tmp);
			}
		}
		if (C[sz].empty()) {cout << sz - 1; return 0;}
		// cout << sz << "!!" << '\n';
		// for (auto clique : C[sz]) {
			// for (int i : clique) cout << i << ' ';
			// cout << '\n';
		// }
	}
	cout << k;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 18 ms 31824 KB Output is correct
4 Correct 17 ms 32000 KB Output is correct
5 Correct 16 ms 31876 KB Output is correct
6 Correct 17 ms 31824 KB Output is correct
7 Correct 29 ms 31824 KB Output is correct
8 Correct 15 ms 31568 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 26 ms 31568 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 18 ms 31824 KB Output is correct
4 Correct 17 ms 32000 KB Output is correct
5 Correct 16 ms 31876 KB Output is correct
6 Correct 17 ms 31824 KB Output is correct
7 Correct 29 ms 31824 KB Output is correct
8 Correct 15 ms 31568 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 26 ms 31568 KB Output is correct
11 Correct 17 ms 31824 KB Output is correct
12 Correct 28 ms 31824 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 25 ms 32008 KB Output is correct
15 Correct 1 ms 504 KB Output is correct
16 Correct 26 ms 31992 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 30 ms 31824 KB Output is correct
19 Correct 15 ms 31568 KB Output is correct
20 Correct 36 ms 31760 KB Output is correct
21 Correct 21 ms 31760 KB Output is correct
22 Correct 14 ms 31572 KB Output is correct
23 Correct 29 ms 32024 KB Output is correct
24 Correct 15 ms 31700 KB Output is correct
25 Correct 30 ms 31824 KB Output is correct
26 Correct 28 ms 31836 KB Output is correct
27 Correct 31 ms 31760 KB Output is correct
28 Correct 28 ms 31824 KB Output is correct
29 Correct 29 ms 31824 KB Output is correct
30 Correct 31 ms 31996 KB Output is correct
31 Correct 30 ms 31824 KB Output is correct
32 Correct 31 ms 31824 KB Output is correct
33 Correct 52 ms 31852 KB Output is correct
34 Correct 32 ms 31824 KB Output is correct
35 Correct 13 ms 17232 KB Output is correct
36 Correct 13 ms 17232 KB Output is correct
37 Correct 12 ms 17268 KB Output is correct
38 Correct 6 ms 9044 KB Output is correct
39 Correct 8 ms 9040 KB Output is correct
40 Correct 38 ms 32304 KB Output is correct
41 Correct 6 ms 9136 KB Output is correct
42 Correct 48 ms 32152 KB Output is correct
43 Correct 54 ms 32140 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 31740 KB Output is correct
2 Correct 2 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 508 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 1 ms 504 KB Output is correct
11 Execution timed out 3087 ms 322248 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 18 ms 31824 KB Output is correct
4 Correct 17 ms 32000 KB Output is correct
5 Correct 16 ms 31876 KB Output is correct
6 Correct 17 ms 31824 KB Output is correct
7 Correct 29 ms 31824 KB Output is correct
8 Correct 15 ms 31568 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 26 ms 31568 KB Output is correct
11 Correct 17 ms 31824 KB Output is correct
12 Correct 28 ms 31824 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 25 ms 32008 KB Output is correct
15 Correct 1 ms 504 KB Output is correct
16 Correct 26 ms 31992 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 30 ms 31824 KB Output is correct
19 Correct 15 ms 31568 KB Output is correct
20 Correct 36 ms 31760 KB Output is correct
21 Correct 21 ms 31760 KB Output is correct
22 Correct 14 ms 31572 KB Output is correct
23 Correct 29 ms 32024 KB Output is correct
24 Correct 15 ms 31700 KB Output is correct
25 Correct 30 ms 31824 KB Output is correct
26 Correct 28 ms 31836 KB Output is correct
27 Correct 31 ms 31760 KB Output is correct
28 Correct 28 ms 31824 KB Output is correct
29 Correct 29 ms 31824 KB Output is correct
30 Correct 31 ms 31996 KB Output is correct
31 Correct 30 ms 31824 KB Output is correct
32 Correct 31 ms 31824 KB Output is correct
33 Correct 52 ms 31852 KB Output is correct
34 Correct 32 ms 31824 KB Output is correct
35 Correct 13 ms 17232 KB Output is correct
36 Correct 13 ms 17232 KB Output is correct
37 Correct 12 ms 17268 KB Output is correct
38 Correct 6 ms 9044 KB Output is correct
39 Correct 8 ms 9040 KB Output is correct
40 Correct 38 ms 32304 KB Output is correct
41 Correct 6 ms 9136 KB Output is correct
42 Correct 48 ms 32152 KB Output is correct
43 Correct 54 ms 32140 KB Output is correct
44 Correct 856 ms 48176 KB Output is correct
45 Correct 1 ms 336 KB Output is correct
46 Correct 41 ms 32140 KB Output is correct
47 Correct 70 ms 32812 KB Output is correct
48 Correct 45 ms 32140 KB Output is correct
49 Correct 66 ms 32908 KB Output is correct
50 Correct 81 ms 32908 KB Output is correct
51 Correct 126 ms 34048 KB Output is correct
52 Correct 18 ms 31824 KB Output is correct
53 Correct 118 ms 34056 KB Output is correct
54 Correct 151 ms 34556 KB Output is correct
55 Correct 27 ms 31992 KB Output is correct
56 Correct 17 ms 31824 KB Output is correct
57 Correct 28 ms 31736 KB Output is correct
58 Correct 113 ms 34056 KB Output is correct
59 Correct 80 ms 32900 KB Output is correct
60 Correct 27 ms 31824 KB Output is correct
61 Correct 87 ms 32916 KB Output is correct
62 Correct 105 ms 32900 KB Output is correct
63 Correct 772 ms 48016 KB Output is correct
64 Correct 398 ms 40192 KB Output is correct
65 Correct 36 ms 32308 KB Output is correct
66 Correct 75 ms 32900 KB Output is correct
67 Correct 242 ms 36608 KB Output is correct
68 Correct 398 ms 40592 KB Output is correct
69 Correct 37 ms 32140 KB Output is correct
70 Correct 78 ms 32936 KB Output is correct
71 Correct 260 ms 36628 KB Output is correct
72 Correct 162 ms 34628 KB Output is correct
73 Correct 28 ms 31824 KB Output is correct
74 Correct 82 ms 33024 KB Output is correct
75 Correct 175 ms 34800 KB Output is correct
76 Correct 46 ms 32396 KB Output is correct
77 Correct 86 ms 33032 KB Output is correct
78 Correct 28 ms 31824 KB Output is correct
79 Correct 30 ms 17804 KB Output is correct
80 Correct 52 ms 32140 KB Output is correct
81 Correct 81 ms 33032 KB Output is correct
82 Correct 7 ms 9040 KB Output is correct
83 Correct 34 ms 17804 KB Output is correct
84 Correct 72 ms 32908 KB Output is correct
85 Correct 7 ms 9040 KB Output is correct
86 Correct 74 ms 32908 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 18 ms 31824 KB Output is correct
4 Correct 17 ms 32000 KB Output is correct
5 Correct 16 ms 31876 KB Output is correct
6 Correct 17 ms 31824 KB Output is correct
7 Correct 29 ms 31824 KB Output is correct
8 Correct 15 ms 31568 KB Output is correct
9 Correct 1 ms 336 KB Output is correct
10 Correct 26 ms 31568 KB Output is correct
11 Correct 17 ms 31824 KB Output is correct
12 Correct 28 ms 31824 KB Output is correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 25 ms 32008 KB Output is correct
15 Correct 1 ms 504 KB Output is correct
16 Correct 26 ms 31992 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 30 ms 31824 KB Output is correct
19 Correct 15 ms 31568 KB Output is correct
20 Correct 36 ms 31760 KB Output is correct
21 Correct 21 ms 31760 KB Output is correct
22 Correct 14 ms 31572 KB Output is correct
23 Correct 29 ms 32024 KB Output is correct
24 Correct 15 ms 31700 KB Output is correct
25 Correct 30 ms 31824 KB Output is correct
26 Correct 28 ms 31836 KB Output is correct
27 Correct 31 ms 31760 KB Output is correct
28 Correct 28 ms 31824 KB Output is correct
29 Correct 29 ms 31824 KB Output is correct
30 Correct 31 ms 31996 KB Output is correct
31 Correct 30 ms 31824 KB Output is correct
32 Correct 31 ms 31824 KB Output is correct
33 Correct 52 ms 31852 KB Output is correct
34 Correct 32 ms 31824 KB Output is correct
35 Correct 13 ms 17232 KB Output is correct
36 Correct 13 ms 17232 KB Output is correct
37 Correct 12 ms 17268 KB Output is correct
38 Correct 6 ms 9044 KB Output is correct
39 Correct 8 ms 9040 KB Output is correct
40 Correct 38 ms 32304 KB Output is correct
41 Correct 6 ms 9136 KB Output is correct
42 Correct 48 ms 32152 KB Output is correct
43 Correct 54 ms 32140 KB Output is correct
44 Correct 1 ms 336 KB Output is correct
45 Correct 2987 ms 320296 KB Output is correct
46 Correct 2223 ms 314656 KB Output is correct
47 Correct 2860 ms 320504 KB Output is correct
48 Correct 2835 ms 320500 KB Output is correct
49 Correct 940 ms 312360 KB Output is correct
50 Execution timed out 3048 ms 321500 KB Time limit exceeded
51 Halted 0 ms 0 KB -