답안 #924415

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
924415 2024-02-09T03:23:11 Z Faisal_Saqib Political Development (BOI17_politicaldevelopment) C++17
0 / 100
8 ms 31324 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))
	{
		x=(np&ma[l]);
		recur(sz,x);
	}
	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 8 ms 31324 KB Output is correct
4 Correct 4 ms 31324 KB Output is correct
5 Correct 4 ms 31304 KB Output is correct
6 Correct 5 ms 31320 KB Output is correct
7 Correct 5 ms 31324 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Incorrect 1 ms 4444 KB Output isn't correct
11 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 8 ms 31324 KB Output is correct
4 Correct 4 ms 31324 KB Output is correct
5 Correct 4 ms 31304 KB Output is correct
6 Correct 5 ms 31320 KB Output is correct
7 Correct 5 ms 31324 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Incorrect 1 ms 4444 KB Output isn't correct
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 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 8 ms 31324 KB Output is correct
4 Correct 4 ms 31324 KB Output is correct
5 Correct 4 ms 31304 KB Output is correct
6 Correct 5 ms 31320 KB Output is correct
7 Correct 5 ms 31324 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Incorrect 1 ms 4444 KB Output isn't correct
11 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 8 ms 31324 KB Output is correct
4 Correct 4 ms 31324 KB Output is correct
5 Correct 4 ms 31304 KB Output is correct
6 Correct 5 ms 31320 KB Output is correct
7 Correct 5 ms 31324 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Incorrect 1 ms 4444 KB Output isn't correct
11 Halted 0 ms 0 KB -