1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
#include <iostream> #include <map> #include <string> using namespace std; map<int,int> np; map<char,int> mp; int main() { int n,kase=1; string s; while(cin>>n) { int cool=0; for(int i=0;i<n;i++) { cin>>s; if(s.size()==1) continue; mp.clear(); np.clear(); for(int i=0;i<s.size();i++) { mp[s[i]]++; } for(map<char,int>::iterator ii=mp.begin();ii!=mp.end();++ii) { np[ii->second]=1; } if(np.size()==mp.size()) cool++; } cout<<"Case "<<kase++<<": "<<cool<<"\n"; } } |