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,c=1,o=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;
- maxxp = o;
- }
- else if(o == M.end()-1){
- for(map<string,int>::iterator it = M.begin(); it != M.end(); ++it){
- if(maxx = it->second){
- c++;
- V.push_back(it->first);
- }
- }
- }
- o++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement