Advertisement
Saleh127

spoj friends

Oct 9th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);cout.tie(0);
  9.  
  10. set<ll>c;
  11. set<ll>::iterator it;
  12. ll a[10000]={0},d,e,f,i,j,k,l=0;
  13. cin>>d;
  14. while(d--)
  15. {
  16. cin>>e;
  17. a[e]=1;
  18. cin>>f;
  19. while(f--)
  20. {
  21. cin>>k;
  22. c.insert(k);
  23. }
  24. }
  25. for(it=c.begin();it!=c.end();it++)
  26. {
  27. if(a[*it]==0)
  28. {
  29. l++;
  30. }
  31. }
  32. cout<<l<<endl;
  33. return 0;
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement