Advertisement
XandreasrektsX

Untitled

Oct 16th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include <map>
  2. #include <cstdio>
  3. #include <vector>
  4. #include <iostream>
  5. #include <algorithm>
  6. using namespace std;
  7.  
  8.  
  9. int main() {
  10.  
  11. int N,maxx=-1, maxxp=0,c=1,o=0;
  12.  
  13. cin >> N;
  14.  
  15. string str;
  16.  
  17. map<string, int> M;
  18. vector<string> V;
  19. for(int i = 0; i<N*2; i++){
  20. cin >> str;
  21. M[str] += 1;
  22. }
  23. for(map<string,int>::iterator itt = M.begin(); itt != M.end(); ++itt){
  24. if(itt->second > maxx){
  25. maxx = itt->second;
  26. maxxp = o;
  27. }
  28. else if(o == M.end()-1){
  29.  
  30. for(map<string,int>::iterator it = M.begin(); it != M.end(); ++it){
  31. if(maxx = it->second){
  32. c++;
  33. V.push_back(it->first);
  34. }
  35.  
  36. }
  37. }
  38. o++;
  39. }
  40.  
  41.  
  42.  
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement