답안 #924421

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

Compilation message

politicaldevelopment.cpp: In function 'int main()':
politicaldevelopment.cpp:28:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   28 |  scanf("%d %d",&n,&k);
      |  ~~~~~^~~~~~~~~~~~~~~
politicaldevelopment.cpp:32:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |   scanf("%d",&d);
      |   ~~~~~^~~~~~~~~
politicaldevelopment.cpp:36:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   36 |    scanf("%d",&x);
      |    ~~~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 22 ms 31324 KB Output is correct
4 Correct 20 ms 31576 KB Output is correct
5 Correct 22 ms 31324 KB Output is correct
6 Correct 21 ms 31324 KB Output is correct
7 Correct 21 ms 31324 KB Output is correct
8 Correct 6 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 5 ms 4600 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 22 ms 31324 KB Output is correct
4 Correct 20 ms 31576 KB Output is correct
5 Correct 22 ms 31324 KB Output is correct
6 Correct 21 ms 31324 KB Output is correct
7 Correct 21 ms 31324 KB Output is correct
8 Correct 6 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 5 ms 4600 KB Output is correct
11 Correct 20 ms 31324 KB Output is correct
12 Correct 20 ms 31324 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 19 ms 31324 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 20 ms 31324 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 21 ms 31380 KB Output is correct
19 Correct 6 ms 348 KB Output is correct
20 Correct 17 ms 31388 KB Output is correct
21 Correct 16 ms 31324 KB Output is correct
22 Correct 5 ms 4444 KB Output is correct
23 Correct 24 ms 31324 KB Output is correct
24 Correct 5 ms 4440 KB Output is correct
25 Correct 26 ms 31324 KB Output is correct
26 Correct 24 ms 31376 KB Output is correct
27 Correct 22 ms 31320 KB Output is correct
28 Correct 23 ms 31324 KB Output is correct
29 Correct 22 ms 31324 KB Output is correct
30 Correct 25 ms 31320 KB Output is correct
31 Correct 26 ms 31324 KB Output is correct
32 Correct 25 ms 31320 KB Output is correct
33 Correct 28 ms 31324 KB Output is correct
34 Correct 26 ms 31324 KB Output is correct
35 Correct 12 ms 16988 KB Output is correct
36 Correct 13 ms 16988 KB Output is correct
37 Correct 11 ms 16988 KB Output is correct
38 Correct 7 ms 8796 KB Output is correct
39 Correct 7 ms 9048 KB Output is correct
40 Correct 33 ms 31324 KB Output is correct
41 Correct 7 ms 8796 KB Output is correct
42 Correct 36 ms 31404 KB Output is correct
43 Correct 34 ms 31324 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 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 604 KB Output is correct
7 Correct 1 ms 604 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 604 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 745 ms 306540 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1739 ms 306612 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 724 ms 306544 KB Output is correct
16 Correct 826 ms 306600 KB Output is correct
17 Correct 1730 ms 306616 KB Output is correct
18 Correct 825 ms 306600 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 22 ms 31324 KB Output is correct
4 Correct 20 ms 31576 KB Output is correct
5 Correct 22 ms 31324 KB Output is correct
6 Correct 21 ms 31324 KB Output is correct
7 Correct 21 ms 31324 KB Output is correct
8 Correct 6 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 5 ms 4600 KB Output is correct
11 Correct 20 ms 31324 KB Output is correct
12 Correct 20 ms 31324 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 19 ms 31324 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 20 ms 31324 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 21 ms 31380 KB Output is correct
19 Correct 6 ms 348 KB Output is correct
20 Correct 17 ms 31388 KB Output is correct
21 Correct 16 ms 31324 KB Output is correct
22 Correct 5 ms 4444 KB Output is correct
23 Correct 24 ms 31324 KB Output is correct
24 Correct 5 ms 4440 KB Output is correct
25 Correct 26 ms 31324 KB Output is correct
26 Correct 24 ms 31376 KB Output is correct
27 Correct 22 ms 31320 KB Output is correct
28 Correct 23 ms 31324 KB Output is correct
29 Correct 22 ms 31324 KB Output is correct
30 Correct 25 ms 31320 KB Output is correct
31 Correct 26 ms 31324 KB Output is correct
32 Correct 25 ms 31320 KB Output is correct
33 Correct 28 ms 31324 KB Output is correct
34 Correct 26 ms 31324 KB Output is correct
35 Correct 12 ms 16988 KB Output is correct
36 Correct 13 ms 16988 KB Output is correct
37 Correct 11 ms 16988 KB Output is correct
38 Correct 7 ms 8796 KB Output is correct
39 Correct 7 ms 9048 KB Output is correct
40 Correct 33 ms 31324 KB Output is correct
41 Correct 7 ms 8796 KB Output is correct
42 Correct 36 ms 31404 KB Output is correct
43 Correct 34 ms 31324 KB Output is correct
44 Execution timed out 3044 ms 31464 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 22 ms 31324 KB Output is correct
4 Correct 20 ms 31576 KB Output is correct
5 Correct 22 ms 31324 KB Output is correct
6 Correct 21 ms 31324 KB Output is correct
7 Correct 21 ms 31324 KB Output is correct
8 Correct 6 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 5 ms 4600 KB Output is correct
11 Correct 20 ms 31324 KB Output is correct
12 Correct 20 ms 31324 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 19 ms 31324 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 20 ms 31324 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 21 ms 31380 KB Output is correct
19 Correct 6 ms 348 KB Output is correct
20 Correct 17 ms 31388 KB Output is correct
21 Correct 16 ms 31324 KB Output is correct
22 Correct 5 ms 4444 KB Output is correct
23 Correct 24 ms 31324 KB Output is correct
24 Correct 5 ms 4440 KB Output is correct
25 Correct 26 ms 31324 KB Output is correct
26 Correct 24 ms 31376 KB Output is correct
27 Correct 22 ms 31320 KB Output is correct
28 Correct 23 ms 31324 KB Output is correct
29 Correct 22 ms 31324 KB Output is correct
30 Correct 25 ms 31320 KB Output is correct
31 Correct 26 ms 31324 KB Output is correct
32 Correct 25 ms 31320 KB Output is correct
33 Correct 28 ms 31324 KB Output is correct
34 Correct 26 ms 31324 KB Output is correct
35 Correct 12 ms 16988 KB Output is correct
36 Correct 13 ms 16988 KB Output is correct
37 Correct 11 ms 16988 KB Output is correct
38 Correct 7 ms 8796 KB Output is correct
39 Correct 7 ms 9048 KB Output is correct
40 Correct 33 ms 31324 KB Output is correct
41 Correct 7 ms 8796 KB Output is correct
42 Correct 36 ms 31404 KB Output is correct
43 Correct 34 ms 31324 KB Output is correct
44 Correct 0 ms 348 KB Output is correct
45 Correct 507 ms 306524 KB Output is correct
46 Correct 347 ms 306512 KB Output is correct
47 Correct 520 ms 306768 KB Output is correct
48 Correct 522 ms 306776 KB Output is correct
49 Correct 201 ms 306260 KB Output is correct
50 Correct 500 ms 306516 KB Output is correct
51 Correct 511 ms 306516 KB Output is correct
52 Correct 219 ms 306408 KB Output is correct
53 Correct 198 ms 306260 KB Output is correct
54 Correct 44 ms 852 KB Output is correct
55 Correct 498 ms 306528 KB Output is correct
56 Correct 169 ms 306260 KB Output is correct
57 Correct 220 ms 306256 KB Output is correct
58 Correct 961 ms 306768 KB Output is correct
59 Correct 180 ms 306516 KB Output is correct
60 Correct 174 ms 306256 KB Output is correct
61 Correct 957 ms 306540 KB Output is correct
62 Correct 359 ms 306472 KB Output is correct
63 Correct 369 ms 306512 KB Output is correct
64 Correct 170 ms 306264 KB Output is correct
65 Correct 569 ms 307024 KB Output is correct
66 Correct 399 ms 306508 KB Output is correct
67 Correct 364 ms 306512 KB Output is correct
68 Correct 433 ms 306536 KB Output is correct
69 Correct 560 ms 306544 KB Output is correct
70 Correct 251 ms 306748 KB Output is correct
71 Correct 418 ms 306324 KB Output is correct
72 Correct 317 ms 306556 KB Output is correct
73 Correct 452 ms 306516 KB Output is correct
74 Correct 247 ms 306460 KB Output is correct
75 Correct 184 ms 154540 KB Output is correct
76 Correct 308 ms 306516 KB Output is correct
77 Correct 456 ms 306656 KB Output is correct
78 Correct 220 ms 154452 KB Output is correct
79 Correct 187 ms 154704 KB Output is correct
80 Correct 83 ms 78532 KB Output is correct
81 Correct 224 ms 154448 KB Output is correct
82 Correct 385 ms 306660 KB Output is correct
83 Correct 84 ms 78428 KB Output is correct
84 Correct 375 ms 306528 KB Output is correct