Advertisement
a53

Grade3

a53
May 15th, 2022
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int GE[101],GI[101],n, m, gasit;
  5. int sol[101], ls;
  6. int main()
  7. {
  8. cin>>n>>m;
  9. for(int i=1; i<=m; i++)
  10. {
  11. int x,y;
  12. cin>>x>>y;
  13. GE[x]++;
  14. GI[y]++;
  15. }
  16. for(int i=1; i<=n; i++)
  17. if(GE[i]<GI[i])
  18. {
  19. gasit++;
  20. sol[++ls]=i;
  21. }
  22. cout<<gasit<<'\n';
  23. for(int i=1; i<=ls; ++i)
  24. cout<<sol[i]<<" ";
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement