Submission #924410

#TimeUsernameProblemLanguageResultExecution timeMemory
924410Faisal_SaqibPolitical Development (BOI17_politicaldevelopment)C++17
62 / 100
3034 ms309328 KiB
#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; for(int l=x._Find_first();l<x.size();l=x._Find_next(l)) { bitset<N> np=(x&ma[l]); recur(sz+1,np); } } 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; recur(0,tp); cout<<mx<<'\n'; return 0; }

Compilation message (stderr)

politicaldevelopment.cpp: In function 'void recur(int, std::bitset<50000>&)':
politicaldevelopment.cpp:13:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::size_t' {aka 'long unsigned int'} [-Wsign-compare]
   13 |  for(int l=x._Find_first();l<x.size();l=x._Find_next(l))
      |                            ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...