提交时间:2022-07-19 12:10:10

运行 ID: 52431

#include <bits/stdc++.h> using namespace std; int n,m,tot,x,k; bool t[8005]; int main() { cin>>n>>m; for(int i=1; i<=m; i++) { cin>>k; for(int j=1; j<=k; j++) { cin>>x; t[x]++; } } for(int i=1; i<=n; i++) if(t[i]) tot++; cout<<tot/2; }