Language: C++

using namespace std;

int main(){
  int n;
  cin>>n;
  vector<pair<int,string>> data(10000);
  int kake[26];
  int cnt =1;

  for(int i=0; i<26; i++){
    kake[i] = cnt;
    cnt += 2;
  }
  
  int ans = 0;

  for (int i=10000-1; i>=0; i--){
    data[i].first = 0;
  }

  for(int i=0; i<n; i++){
    string s;
    cin>>s;
    int v =0 ;
    for(int j=0; j<s.size(); j++){
      int ind;
      ind = (s[j]-'a');
      v +=  kake[ind]*kake[ind];
    }
    
    data[v].first++;
    ans = max(ans,data[v].first);
    data[v].second = s;
  }

  sort(data.begin(),data.end());

  vector<string> res;

  for(int i=10000-1; i>=0; i--){
    if(ans != data[i].first) break;
    res.push_back(data[i].second);
  }

  sort(res.begin(),res.end());

  for(int i=0; i<res.size(); i++){
    cout<<res[i]<<endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<pair<int,string>> data(10000);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:6:10: error: 'pair' was not declared in this scope
    6 |   vector<pair<int,string>> data(10000);
      |          ^~~~
a.cc:1:1: note: 'std::pair' is defined in header '<utility>'; this is probably fixable by adding '#include <utility>'
  +++ |+#include <utility>
    1 | using namespace std;
a.cc:6:15: error: expected primary-expression before 'int'
    6 |   vector<pair<int,string>> data(10000);
      |               ^~~
a.cc:18:5: error: 'data' was not declared in this scope
   18 |     data[i].first = 0;
      |     ^~~~
a.cc:22:5: error: 'string' was not declared in this scope
   22 |     string s;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:23:10: error: 's' was not declared in this scope
   23 |     cin>>s;
      |          ^
a.cc:31:5: error: 'data' was not declared in this scope
   31 |     data[v].first++;
      |     ^~~~
a.cc:32:11: error: 'max' was not declared in this scope
   32 |     ans = max(ans,data[v].first);
      |           ^~~
a.cc:36:8: error: 'data' was not declared in this scope
   36 |   sort(data.begin(),data.end());
      |        ^~~~
a.cc:36:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   36 |   sort(data.begin(),data.end());
      |   ^~~~
      |   short
a.cc:38:10: error: 'string' was not declared in this scope
   38 |   vector<string> res;
      |          ^~~~~~
a.cc:38:10: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:38:18: error: 'res' was not declared in this scope
   38 |   vector<string> res;
      |                  ^~~
a.cc:48:5: error: 'cout' was not declared in this scope
   48 |     cout<<res[i]<<endl;
      |     ^~~~
a.cc:48:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:48:19: error: 'endl' was not declared in this scope
   48 |     cout<<res[i]<<endl;
      |                   ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;