Advertisement
amine99

Untitled

May 1st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define _ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  4. typedef long long ll;
  5.  
  6. int main() {_
  7.  map<string,int> ans;
  8.  map<char,int> m;
  9.  int n,res=0;
  10.  cin >> n ;
  11.  string s,ch="";
  12.  for(int i=0;i<n;i++){
  13.     cin >> s;
  14.     ch="";
  15.     for(int j=0;j<s.length();j++)
  16.         m[s[j]]=1;
  17.     for (std::map<char,int>::iterator it=m.begin(); it!=m.end(); ++it){
  18.         ch+=it->first ;
  19.     }
  20.     ans[ch]=1;
  21.     m.clear();
  22.  }
  23.  for (std::map<string,int>::iterator it=ans.begin(); it!=ans.end(); ++it){
  24.         res++;
  25.     }
  26.     cout <<res ;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement