Advertisement
a53

Turneu1

a53
Jan 10th, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int n, m,DA[21],NU[21],nr,numsg,maxind;
  4. char ch;
  5.  
  6. int main()
  7. {
  8. cin>>n>>m;
  9. for(int i=1;i<=m;++i)
  10. {
  11. cin>>ch>>nr;
  12. if(ch=='D')
  13. ++DA[nr];
  14. else
  15. ++NU[nr];
  16. }
  17. for(int i=1;i<=n;++i)
  18. {
  19. if(DA[i]==0&&NU[i]==0)
  20. ++numsg;
  21. if(DA[i]+NU[i]>maxind)
  22. maxind=(DA[i]+NU[i]);
  23. if(DA[i]-NU[i]>0)
  24. cout<<i<<' ';
  25. }
  26. cout<<'\n';
  27. for(int i=1;i<=n;++i)
  28. if(DA[i]+NU[i]==maxind)
  29. cout<<i<<' ';
  30. cout<<'\n'<<numsg;
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement