Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <algorithm>
- #include <vector>
- #include <map>
- using namespace std;
- ifstream f("pluton.in");
- ofstream g("pluton.out");
- int n,i,cnt,maxx,apmaxx;
- string S,aux,St;
- map < string, vector<string> >Pluton;
- int main()
- {
- f >> n;
- for(i=1;i<=n;i++)
- {
- f >> S;
- aux = S;
- sort(aux.begin(),aux.end());
- Pluton[aux].push_back(S);
- }
- map < string, vector<string> >::iterator it = Pluton.begin();
- map < string, vector<string> >::iterator itr;
- apmaxx = 0;
- for(;it != Pluton.end();it++)
- {
- if(it->second.size()>maxx)
- {
- maxx = it->second.size();
- apmaxx = 1;
- St = it->first;
- }else if(maxx == it->second.size())apmaxx++;
- }
- g << Pluton.size() << "\n";
- g << maxx << "\n";
- g << apmaxx << "\n";
- for(auto xc:Pluton[St])
- g << xc << " ";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement