답안 #924413

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
924413 2024-02-09T03:20:08 Z Faisal_Saqib Political Development (BOI17_politicaldevelopment) C++17
62 / 100
3000 ms 306784 KB
#include <iostream>
#include <bitset> 
// any
using namespace std;
const int N=5e4;
bitset<N> ma[N];
int n,k,mx=0;
void recur(int& sz,bitset<N>&x)
{
	mx=max(mx,sz);	
	if(x.none())
		return;
	sz++;
	for(int l=x._Find_first();l<x.size();l=x._Find_next(l))
	{
		bitset<N> np=(x&ma[l]);
		recur(sz,np);
	}
	sz--;
}
int main()
{
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(0);
	cin>>n>>k;
	for(int i=0;i<n;i++)
	{
		int d=0;
		cin>>d;
		while(d--)
		{
			int x;
			cin>>x;
			ma[i].set(x);
		}
	}
	bitset<N> tp;
	for(int i=0;i<n;i++)
		tp[i]=1;
	int s=0;		
	recur(s,tp);
	cout<<mx<<'\n';
	return 0;
}

Compilation message

politicaldevelopment.cpp: In function 'void recur(int&, std::bitset<50000>&)':
politicaldevelopment.cpp:14:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'long unsigned int'} [-Wsign-compare]
   14 |  for(int l=x._Find_first();l<x.size();l=x._Find_next(l))
      |                            ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 19 ms 31324 KB Output is correct
4 Correct 16 ms 31324 KB Output is correct
5 Correct 21 ms 31324 KB Output is correct
6 Correct 17 ms 31372 KB Output is correct
7 Correct 18 ms 31324 KB Output is correct
8 Correct 4 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 4 ms 4440 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 19 ms 31324 KB Output is correct
4 Correct 16 ms 31324 KB Output is correct
5 Correct 21 ms 31324 KB Output is correct
6 Correct 17 ms 31372 KB Output is correct
7 Correct 18 ms 31324 KB Output is correct
8 Correct 4 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 4 ms 4440 KB Output is correct
11 Correct 21 ms 31324 KB Output is correct
12 Correct 16 ms 31364 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 16 ms 31372 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 18 ms 31324 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 18 ms 31332 KB Output is correct
19 Correct 4 ms 344 KB Output is correct
20 Correct 14 ms 31324 KB Output is correct
21 Correct 14 ms 31324 KB Output is correct
22 Correct 5 ms 4444 KB Output is correct
23 Correct 22 ms 31388 KB Output is correct
24 Correct 5 ms 4444 KB Output is correct
25 Correct 25 ms 31324 KB Output is correct
26 Correct 20 ms 31324 KB Output is correct
27 Correct 21 ms 31324 KB Output is correct
28 Correct 23 ms 31324 KB Output is correct
29 Correct 19 ms 31320 KB Output is correct
30 Correct 23 ms 31384 KB Output is correct
31 Correct 23 ms 31320 KB Output is correct
32 Correct 21 ms 31324 KB Output is correct
33 Correct 26 ms 31580 KB Output is correct
34 Correct 24 ms 31324 KB Output is correct
35 Correct 12 ms 17016 KB Output is correct
36 Correct 11 ms 17012 KB Output is correct
37 Correct 10 ms 17012 KB Output is correct
38 Correct 6 ms 8796 KB Output is correct
39 Correct 6 ms 8800 KB Output is correct
40 Correct 29 ms 31372 KB Output is correct
41 Correct 6 ms 8792 KB Output is correct
42 Correct 29 ms 31324 KB Output is correct
43 Correct 31 ms 31324 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 600 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 676 ms 306648 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1436 ms 306556 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 671 ms 306520 KB Output is correct
16 Correct 742 ms 306520 KB Output is correct
17 Correct 1449 ms 306556 KB Output is correct
18 Correct 744 ms 306548 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 19 ms 31324 KB Output is correct
4 Correct 16 ms 31324 KB Output is correct
5 Correct 21 ms 31324 KB Output is correct
6 Correct 17 ms 31372 KB Output is correct
7 Correct 18 ms 31324 KB Output is correct
8 Correct 4 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 4 ms 4440 KB Output is correct
11 Correct 21 ms 31324 KB Output is correct
12 Correct 16 ms 31364 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 16 ms 31372 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 18 ms 31324 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 18 ms 31332 KB Output is correct
19 Correct 4 ms 344 KB Output is correct
20 Correct 14 ms 31324 KB Output is correct
21 Correct 14 ms 31324 KB Output is correct
22 Correct 5 ms 4444 KB Output is correct
23 Correct 22 ms 31388 KB Output is correct
24 Correct 5 ms 4444 KB Output is correct
25 Correct 25 ms 31324 KB Output is correct
26 Correct 20 ms 31324 KB Output is correct
27 Correct 21 ms 31324 KB Output is correct
28 Correct 23 ms 31324 KB Output is correct
29 Correct 19 ms 31320 KB Output is correct
30 Correct 23 ms 31384 KB Output is correct
31 Correct 23 ms 31320 KB Output is correct
32 Correct 21 ms 31324 KB Output is correct
33 Correct 26 ms 31580 KB Output is correct
34 Correct 24 ms 31324 KB Output is correct
35 Correct 12 ms 17016 KB Output is correct
36 Correct 11 ms 17012 KB Output is correct
37 Correct 10 ms 17012 KB Output is correct
38 Correct 6 ms 8796 KB Output is correct
39 Correct 6 ms 8800 KB Output is correct
40 Correct 29 ms 31372 KB Output is correct
41 Correct 6 ms 8792 KB Output is correct
42 Correct 29 ms 31324 KB Output is correct
43 Correct 31 ms 31324 KB Output is correct
44 Execution timed out 3048 ms 31416 KB Time limit exceeded
45 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 19 ms 31324 KB Output is correct
4 Correct 16 ms 31324 KB Output is correct
5 Correct 21 ms 31324 KB Output is correct
6 Correct 17 ms 31372 KB Output is correct
7 Correct 18 ms 31324 KB Output is correct
8 Correct 4 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 4 ms 4440 KB Output is correct
11 Correct 21 ms 31324 KB Output is correct
12 Correct 16 ms 31364 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 16 ms 31372 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 18 ms 31324 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 18 ms 31332 KB Output is correct
19 Correct 4 ms 344 KB Output is correct
20 Correct 14 ms 31324 KB Output is correct
21 Correct 14 ms 31324 KB Output is correct
22 Correct 5 ms 4444 KB Output is correct
23 Correct 22 ms 31388 KB Output is correct
24 Correct 5 ms 4444 KB Output is correct
25 Correct 25 ms 31324 KB Output is correct
26 Correct 20 ms 31324 KB Output is correct
27 Correct 21 ms 31324 KB Output is correct
28 Correct 23 ms 31324 KB Output is correct
29 Correct 19 ms 31320 KB Output is correct
30 Correct 23 ms 31384 KB Output is correct
31 Correct 23 ms 31320 KB Output is correct
32 Correct 21 ms 31324 KB Output is correct
33 Correct 26 ms 31580 KB Output is correct
34 Correct 24 ms 31324 KB Output is correct
35 Correct 12 ms 17016 KB Output is correct
36 Correct 11 ms 17012 KB Output is correct
37 Correct 10 ms 17012 KB Output is correct
38 Correct 6 ms 8796 KB Output is correct
39 Correct 6 ms 8800 KB Output is correct
40 Correct 29 ms 31372 KB Output is correct
41 Correct 6 ms 8792 KB Output is correct
42 Correct 29 ms 31324 KB Output is correct
43 Correct 31 ms 31324 KB Output is correct
44 Correct 1 ms 344 KB Output is correct
45 Correct 471 ms 306528 KB Output is correct
46 Correct 299 ms 306484 KB Output is correct
47 Correct 467 ms 306784 KB Output is correct
48 Correct 471 ms 306768 KB Output is correct
49 Correct 180 ms 306260 KB Output is correct
50 Correct 423 ms 306724 KB Output is correct
51 Correct 471 ms 306516 KB Output is correct
52 Correct 195 ms 306260 KB Output is correct
53 Correct 195 ms 306404 KB Output is correct
54 Correct 33 ms 856 KB Output is correct
55 Correct 427 ms 306512 KB Output is correct
56 Correct 152 ms 306256 KB Output is correct
57 Correct 194 ms 306384 KB Output is correct
58 Correct 772 ms 306520 KB Output is correct
59 Correct 151 ms 306404 KB Output is correct
60 Correct 156 ms 306404 KB Output is correct
61 Correct 776 ms 306756 KB Output is correct
62 Correct 301 ms 306452 KB Output is correct
63 Correct 331 ms 306496 KB Output is correct
64 Correct 153 ms 306388 KB Output is correct
65 Correct 532 ms 306520 KB Output is correct
66 Correct 316 ms 306260 KB Output is correct
67 Correct 324 ms 306480 KB Output is correct
68 Correct 368 ms 306516 KB Output is correct
69 Correct 487 ms 306516 KB Output is correct
70 Correct 216 ms 306260 KB Output is correct
71 Correct 380 ms 306532 KB Output is correct
72 Correct 280 ms 306260 KB Output is correct
73 Correct 421 ms 306512 KB Output is correct
74 Correct 216 ms 306472 KB Output is correct
75 Correct 160 ms 154460 KB Output is correct
76 Correct 286 ms 306516 KB Output is correct
77 Correct 413 ms 306512 KB Output is correct
78 Correct 213 ms 154712 KB Output is correct
79 Correct 160 ms 154492 KB Output is correct
80 Correct 69 ms 78428 KB Output is correct
81 Correct 206 ms 154516 KB Output is correct
82 Correct 345 ms 306516 KB Output is correct
83 Correct 79 ms 78424 KB Output is correct
84 Correct 350 ms 306516 KB Output is correct