답안 #924418

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
924418 2024-02-09T03:25:18 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++;
	bitset<N> np=x;
	for(int l=x._Find_first();l<x.size();l=x._Find_next(l))
	{
		np=(x&ma[l]);
		recur(sz,np);
	}
	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);
		}
	}
	bitset<N> tp;
	for(int i=0;i<n;i++)
		tp[i]=1;
	int s=0;		
	recur(s,tp);
	printf("%d",mx);
	return 0;
}

Compilation message

politicaldevelopment.cpp: In function 'void recur(int&, std::bitset<50000>&)':
politicaldevelopment.cpp:15:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'long unsigned int'} [-Wsign-compare]
   15 |  for(int l=x._Find_first();l<x.size();l=x._Find_next(l))
      |                            ~^~~~~~~~~
politicaldevelopment.cpp: In function 'int main()':
politicaldevelopment.cpp:27:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 |  scanf("%d %d",&n,&k);
      |  ~~~~~^~~~~~~~~~~~~~~
politicaldevelopment.cpp:31:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |   scanf("%d",&d);
      |   ~~~~~^~~~~~~~~
politicaldevelopment.cpp:35:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |    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 27 ms 31368 KB Output is correct
4 Correct 19 ms 31324 KB Output is correct
5 Correct 18 ms 31324 KB Output is correct
6 Correct 20 ms 31320 KB Output is correct
7 Correct 21 ms 31324 KB Output is correct
8 Correct 5 ms 600 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 5 ms 4444 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 27 ms 31368 KB Output is correct
4 Correct 19 ms 31324 KB Output is correct
5 Correct 18 ms 31324 KB Output is correct
6 Correct 20 ms 31320 KB Output is correct
7 Correct 21 ms 31324 KB Output is correct
8 Correct 5 ms 600 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 5 ms 4444 KB Output is correct
11 Correct 18 ms 31324 KB Output is correct
12 Correct 19 ms 31324 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 19 ms 31388 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 20 ms 31384 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 21 ms 31324 KB Output is correct
19 Correct 5 ms 348 KB Output is correct
20 Correct 21 ms 31320 KB Output is correct
21 Correct 23 ms 31324 KB Output is correct
22 Correct 5 ms 4444 KB Output is correct
23 Correct 25 ms 31408 KB Output is correct
24 Correct 5 ms 4444 KB Output is correct
25 Correct 26 ms 31320 KB Output is correct
26 Correct 26 ms 31324 KB Output is correct
27 Correct 28 ms 31320 KB Output is correct
28 Correct 23 ms 31324 KB Output is correct
29 Correct 21 ms 31324 KB Output is correct
30 Correct 36 ms 31324 KB Output is correct
31 Correct 27 ms 31324 KB Output is correct
32 Correct 31 ms 31324 KB Output is correct
33 Correct 26 ms 31324 KB Output is correct
34 Correct 25 ms 31324 KB Output is correct
35 Correct 13 ms 16988 KB Output is correct
36 Correct 11 ms 16984 KB Output is correct
37 Correct 13 ms 16988 KB Output is correct
38 Correct 7 ms 8796 KB Output is correct
39 Correct 7 ms 8796 KB Output is correct
40 Correct 34 ms 31324 KB Output is correct
41 Correct 7 ms 8796 KB Output is correct
42 Correct 33 ms 31576 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 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 600 KB Output is correct
6 Correct 1 ms 604 KB Output is correct
7 Correct 2 ms 604 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 604 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 768 ms 306536 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1661 ms 306608 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 755 ms 306748 KB Output is correct
16 Correct 808 ms 306604 KB Output is correct
17 Correct 1692 ms 306616 KB Output is correct
18 Correct 818 ms 306524 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 27 ms 31368 KB Output is correct
4 Correct 19 ms 31324 KB Output is correct
5 Correct 18 ms 31324 KB Output is correct
6 Correct 20 ms 31320 KB Output is correct
7 Correct 21 ms 31324 KB Output is correct
8 Correct 5 ms 600 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 5 ms 4444 KB Output is correct
11 Correct 18 ms 31324 KB Output is correct
12 Correct 19 ms 31324 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 19 ms 31388 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 20 ms 31384 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 21 ms 31324 KB Output is correct
19 Correct 5 ms 348 KB Output is correct
20 Correct 21 ms 31320 KB Output is correct
21 Correct 23 ms 31324 KB Output is correct
22 Correct 5 ms 4444 KB Output is correct
23 Correct 25 ms 31408 KB Output is correct
24 Correct 5 ms 4444 KB Output is correct
25 Correct 26 ms 31320 KB Output is correct
26 Correct 26 ms 31324 KB Output is correct
27 Correct 28 ms 31320 KB Output is correct
28 Correct 23 ms 31324 KB Output is correct
29 Correct 21 ms 31324 KB Output is correct
30 Correct 36 ms 31324 KB Output is correct
31 Correct 27 ms 31324 KB Output is correct
32 Correct 31 ms 31324 KB Output is correct
33 Correct 26 ms 31324 KB Output is correct
34 Correct 25 ms 31324 KB Output is correct
35 Correct 13 ms 16988 KB Output is correct
36 Correct 11 ms 16984 KB Output is correct
37 Correct 13 ms 16988 KB Output is correct
38 Correct 7 ms 8796 KB Output is correct
39 Correct 7 ms 8796 KB Output is correct
40 Correct 34 ms 31324 KB Output is correct
41 Correct 7 ms 8796 KB Output is correct
42 Correct 33 ms 31576 KB Output is correct
43 Correct 34 ms 31324 KB Output is correct
44 Execution timed out 3024 ms 31468 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 27 ms 31368 KB Output is correct
4 Correct 19 ms 31324 KB Output is correct
5 Correct 18 ms 31324 KB Output is correct
6 Correct 20 ms 31320 KB Output is correct
7 Correct 21 ms 31324 KB Output is correct
8 Correct 5 ms 600 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 5 ms 4444 KB Output is correct
11 Correct 18 ms 31324 KB Output is correct
12 Correct 19 ms 31324 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 19 ms 31388 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 20 ms 31384 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 21 ms 31324 KB Output is correct
19 Correct 5 ms 348 KB Output is correct
20 Correct 21 ms 31320 KB Output is correct
21 Correct 23 ms 31324 KB Output is correct
22 Correct 5 ms 4444 KB Output is correct
23 Correct 25 ms 31408 KB Output is correct
24 Correct 5 ms 4444 KB Output is correct
25 Correct 26 ms 31320 KB Output is correct
26 Correct 26 ms 31324 KB Output is correct
27 Correct 28 ms 31320 KB Output is correct
28 Correct 23 ms 31324 KB Output is correct
29 Correct 21 ms 31324 KB Output is correct
30 Correct 36 ms 31324 KB Output is correct
31 Correct 27 ms 31324 KB Output is correct
32 Correct 31 ms 31324 KB Output is correct
33 Correct 26 ms 31324 KB Output is correct
34 Correct 25 ms 31324 KB Output is correct
35 Correct 13 ms 16988 KB Output is correct
36 Correct 11 ms 16984 KB Output is correct
37 Correct 13 ms 16988 KB Output is correct
38 Correct 7 ms 8796 KB Output is correct
39 Correct 7 ms 8796 KB Output is correct
40 Correct 34 ms 31324 KB Output is correct
41 Correct 7 ms 8796 KB Output is correct
42 Correct 33 ms 31576 KB Output is correct
43 Correct 34 ms 31324 KB Output is correct
44 Correct 1 ms 344 KB Output is correct
45 Correct 492 ms 306512 KB Output is correct
46 Correct 386 ms 306344 KB Output is correct
47 Correct 504 ms 306768 KB Output is correct
48 Correct 491 ms 306548 KB Output is correct
49 Correct 207 ms 306428 KB Output is correct
50 Correct 485 ms 306772 KB Output is correct
51 Correct 505 ms 306544 KB Output is correct
52 Correct 217 ms 306260 KB Output is correct
53 Correct 205 ms 306244 KB Output is correct
54 Correct 46 ms 860 KB Output is correct
55 Correct 467 ms 306496 KB Output is correct
56 Correct 169 ms 306256 KB Output is correct
57 Correct 212 ms 306256 KB Output is correct
58 Correct 944 ms 306552 KB Output is correct
59 Correct 178 ms 306256 KB Output is correct
60 Correct 183 ms 306516 KB Output is correct
61 Correct 917 ms 306772 KB Output is correct
62 Correct 345 ms 306488 KB Output is correct
63 Correct 387 ms 306524 KB Output is correct
64 Correct 175 ms 306260 KB Output is correct
65 Correct 570 ms 306556 KB Output is correct
66 Correct 355 ms 306512 KB Output is correct
67 Correct 367 ms 306516 KB Output is correct
68 Correct 408 ms 306512 KB Output is correct
69 Correct 593 ms 306784 KB Output is correct
70 Correct 240 ms 306476 KB Output is correct
71 Correct 404 ms 306524 KB Output is correct
72 Correct 303 ms 306260 KB Output is correct
73 Correct 432 ms 306512 KB Output is correct
74 Correct 248 ms 306260 KB Output is correct
75 Correct 178 ms 154716 KB Output is correct
76 Correct 304 ms 306496 KB Output is correct
77 Correct 453 ms 306644 KB Output is correct
78 Correct 215 ms 154448 KB Output is correct
79 Correct 174 ms 154448 KB Output is correct
80 Correct 85 ms 78424 KB Output is correct
81 Correct 220 ms 154532 KB Output is correct
82 Correct 366 ms 306524 KB Output is correct
83 Correct 88 ms 78564 KB Output is correct
84 Correct 390 ms 306532 KB Output is correct