Advertisement
Josif_tepe

Untitled

Nov 3rd, 2022
1,198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <cstring>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n;
  9.     cin >> n;
  10.     vector<pair<pair<int, string>, vector<int> > > v;
  11.     for(int i = 0; i < n; i++) {
  12.         string s;
  13.         cin >> s;
  14.        
  15.         vector<int> cnt(26, 0);
  16.         for(int j = 0; j < s.size(); j++) {
  17.             cnt[s[j] - 'A']++;
  18.         }
  19.         v.push_back(make_pair(make_pair(s.size(), s), cnt));
  20.     }
  21.     sort(v.begin(), v.end());
  22.    
  23.    
  24.  return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement