# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
924410 | Faisal_Saqib | Political Development (BOI17_politicaldevelopment) | C++17 | 3034 ms | 309328 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |