2017-10-03-morning
1 #include <algorithm> 2 #include <cstring> 3 #include <cstdio> 4 5 inline void read(int &x) 6 { 7 x=0; register char ch=getchar(); 8 for(; ch>'9'||ch<'0'; ) ch=getchar(); 9 for(; ch>='0'&&ch<='9'; ch=getchar()) x=x*10+ch-'0'; 10 } 11 const int N(10005); 12 int n,num[110],cnt,ans; 13 long long a[N],tmp; 14 char s[110]; 15 16 int Presist() 17 { 18 freopen("a.in","r",stdin); 19 freopen("a.out","w",stdout); 20 read(n); 21 for(int len; n--; cnt++) 22 { 23 scanf("%s",s+1); len=strlen(s+1); 24 for(int i=1; i<=len; ++i) num[i]=s[i]-'A'+1; 25 std::sort(num+1,num+len+1); 26 for(int i=1; i<=len; ++i) 27 a[cnt]=a[cnt]*233+num[i],s[i]=' '; 28 } 29 std::sort(a,a+cnt); 30 for(int i=0; i<cnt; ++i) 31 if(tmp!=a[i]) ans++,tmp=a[i]; 32 printf("%d\n",ans); 33 return 0; 34 } 35 36 int Aptal=Presist(); 37 int main(int argc,char**argv){;}
1 /* 2 呃呃呃 3 */
1 /* 2 呃呃呃 3 */
——每当你想要放弃的时候,就想想是为了什么才一路坚持到现在。