- #include<stdio.h>
- #include<string.h>
- int mark[1<<16];
- int main()
- {
- int i,j,n,m,k,t,tot;
- while(scanf("%d%d",&n,&m)!=EOF)
- {
- memset(mark,0,sizeof(mark));
- for(i=1;i<=n;i++)
- {
- scanf("%d",&t);
- tot=0;
- for(j=1;j<=t;j++)
- {
- scanf("%d",&k);
- tot=tot|(1<<(k-1));
- }
- mark[tot]=1;
- for(j=1;j<(1<<m);j++)
- {
- if(mark[j])
- {
- mark[j|tot]=1;
- }
- }
- }
- int ans=0;
- for(j=1;j<(1<<(m));j++)
- {
- if(mark[j]) ans++;
- }
- printf("%d\n",ans);
- }
- }
3306
最新推荐文章于 2023-11-16 20:00:17 发布