Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define _ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
- typedef long long ll;
- int main() {_
- map<string,int> ans;
- map<char,int> m;
- int n,res=0;
- cin >> n ;
- string s,ch="";
- for(int i=0;i<n;i++){
- cin >> s;
- ch="";
- for(int j=0;j<s.length();j++)
- m[s[j]]=1;
- for (std::map<char,int>::iterator it=m.begin(); it!=m.end(); ++it){
- ch+=it->first ;
- }
- ans[ch]=1;
- m.clear();
- }
- for (std::map<string,int>::iterator it=ans.begin(); it!=ans.end(); ++it){
- res++;
- }
- cout <<res ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement