提交时间:2022-07-19 11:51:37
运行 ID: 52282
#include<bits/stdc++.h> using namespace std; const int N=8010; int n,m,k[N],c[N][50],ans; int du[N]; map<int,bool> vis; int main(){ bool flag=1; cin>>n>>m; for(register int i=1;i<=m;i++){ cin>>k[i]; for(register int j=1;j<=k[i];j++){ cin>>c[i][j]; vis[c[i][j]]=1; } } ans=n; for(register int i=1;i<=n;i++){ if(!vis[i]) ans--; } cout<<ans/2<<endl; }