#include<bits/stdc++.h>
using namespace std;
unsigned long long bas='z'-'0'+5;
unsigned long long hashh[10010];
unsigned long long temp[1600];
char s[1610];
int ans=1;
inline void read(char *s){
char ch=getchar();
while(ch=='\n')ch=getchar();
while(ch!='\n')*s=ch,++s,ch=getchar();
*s='\0';
}
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
//read(s);
scanf("%s",s);
int num=0;
temp[num]=s[num]-'0'+1;
num++;
while(s[num]){
temp[num]=temp[num-1]*bas+s[num]-'0'+1;
num++;
}
hashh[i]=temp[num-1];
}
sort(hashh,hashh+n);
for(int i=0;i<n-1;i++){
if(hashh[i]!=hashh[i+1])ans++;
}
printf("%d",ans);
return 0;
}
用scanf函数就能全过,用上面的read就会1,2,11wa,难道是读函数写错了?