daily pastebin goal
2%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <fstream>
  3. #include <algorithm>
  4. #include <vector>
  5. #include <map>
  6.  
  7. using namespace std;
  8.  
  9. ifstream f("pluton.in");
  10. ofstream g("pluton.out");
  11.  
  12. int n,i,cnt,maxx,apmaxx;
  13. string S,aux,St;
  14. map < string, vector<string> >Pluton;
  15.  
  16. int main()
  17. {
  18.     f >> n;
  19.     for(i=1;i<=n;i++)
  20.     {
  21.         f >> S;
  22.         aux = S;
  23.         sort(aux.begin(),aux.end());
  24.         Pluton[aux].push_back(S);
  25.     }
  26.     map < string, vector<string> >::iterator it = Pluton.begin();
  27.     map < string, vector<string> >::iterator itr;
  28.     apmaxx = 0;
  29.     for(;it != Pluton.end();it++)
  30.     {
  31.         if(it->second.size()>maxx)
  32.         {
  33.             maxx = it->second.size();
  34.             apmaxx = 1;
  35.             St = it->first;
  36.         }else if(maxx == it->second.size())apmaxx++;
  37.     }
  38.     g << Pluton.size() << "\n";
  39.     g << maxx << "\n";
  40.     g << apmaxx << "\n";
  41.     for(auto xc:Pluton[St])
  42.         g << xc << " ";
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top