Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <map>
- #include <cstdio>
- #include <vector>
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int main() {
- int N,maxx=-1, maxxp=0;
- cin >> N;
- string str;
- map<string, int> M;
- vector<string> V;
- for(int i = 0; i<N*2; i++){
- cin >> str;
- M[str] += 1;
- }
- for(map<string,int>::iterator itt = M.begin(); itt != M.end(); ++itt){
- if(itt->second > maxx){
- maxx = itt->second;
- }
- }
- map<int, string> RM;
- for(auto x:M){
- RM[x.second] = x.first;
- }
- cout << RM.size() << endl;
- for(auto x:RM){
- if(x.first == maxx){
- cout << x.second << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement