fork download
  1. #include <iostream>
  2. #include<set>
  3. #include<vector>
  4. using namespace std;
  5.  
  6. int main() {
  7. int t,e,c=0;
  8. cin>>t;
  9. e=t;
  10. set<int>s;
  11. vector<int>v;
  12. while(t--)
  13. {
  14.  
  15. int f,i;
  16. cin>>f;
  17. v.push_back(f);
  18. int mf;
  19. int arr[mf];
  20. int a;
  21. cin>>mf;
  22. for(i=0;i<mf;i++)
  23. {
  24. cin>>a;
  25. s.insert(a);
  26. }
  27.  
  28. } for(int i=0;i<v.size();i++)
  29. {
  30. if(s.count(v[i]))
  31. c++;
  32. }cout<<s.size()-c<<endl;
  33. // your code goes here
  34. return 0;
  35. }
Success #stdin #stdout 0s 5460KB
stdin
3
2334 5 1256 4323 7687 3244 5678
1256 2 2334 7687
4323 5 2334 5678 6547 9766 9543
stdout
6