Advertisement
Guest User

uva_12820..why RE??

a guest
Feb 14th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     int n,c=1,re;
  6.     char str[100];
  7.     bool arra[100];
  8.     while(scanf("%d\n",&n)==1)
  9.     {
  10.  
  11.         re=0;
  12.         map<char,int>mp;
  13.         while(n--)
  14.         {
  15.             gets(str);
  16.             int len=strlen(str);
  17.  
  18.             for(int i=0; i<len; i++)
  19.                 mp[str[i]]++;
  20.             int pre_len=mp.size();
  21.             if(pre_len==1)continue;
  22.  
  23.  
  24.             bool check=true;
  25.             memset(arra,false,sizeof arra);
  26.  
  27.             for(map<char,int>::iterator it=mp.begin(); it!=mp.end(); it++)
  28.             {
  29.                 int temp=it->second;
  30.                 if(arra[temp])
  31.                 {
  32.                     check=false;
  33.                     break;
  34.                 }
  35.                 else arra[temp]=true;
  36.  
  37.             }
  38.             if(check)re++;
  39.         }
  40.  
  41.         printf("Case %d: %d\n",c++,re);
  42.         mp.clear();
  43.     }
  44.     return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement