Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n, m,DA[21],NU[21],nr,numsg,maxind;
- char ch;
- int main()
- {
- cin>>n>>m;
- for(int i=1;i<=m;++i)
- {
- cin>>ch>>nr;
- if(ch=='D')
- ++DA[nr];
- else
- ++NU[nr];
- }
- for(int i=1;i<=n;++i)
- {
- if(DA[i]==0&&NU[i]==0)
- ++numsg;
- if(DA[i]+NU[i]>maxind)
- maxind=(DA[i]+NU[i]);
- if(DA[i]-NU[i]>0)
- cout<<i<<' ';
- }
- cout<<'\n';
- for(int i=1;i<=n;++i)
- if(DA[i]+NU[i]==maxind)
- cout<<i<<' ';
- cout<<'\n'<<numsg;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement