It's a bad feeling today. Various reading errors test instructions. Water problem ...
That means, give you a few strings. If the same length and the same position characters (no case) the number of more than two is a different string.
1#include <iostream>2#include <cstdio>3#include <cstdlib>4#include <stack>5#include <queue>6#include <vector>7#include <map>8#include <string.h>9#include <algorithm>Ten using namespacestd; One A Charstr[ the][ the]; - intN; - intMain () the { - while(~SCANF ("%d",&N)) - { - intval[ the]; +Memset (Val,0,sizeof(Val)); - intsum=0; + for(intI=0; i<n; i++) Ascanf"%s", Str[i]); at for(intI=0; i<n; i++) - { - for(intj=i+1; j<n; J + +) - { - intlen1=strlen (Str[i]); - intLen2=strlen (Str[j]); in if(len1!=len2) - Continue; to intans=0; + for(intk=0; k<len1; k++) - { the if(str[i][k]==str[j][k]| | str[i][k]-'a'==str[j][k]-'A'|| str[i][k]-'A'==str[j][k]-'a') *ans++; $ }Panax Notoginseng if(ans>2) - { the //if (!val[i]) + //sum+=2; A //Else the //sum++; +val[i]=1; -val[j]=1; $ } $ } - } - for(intI=0; i<n;i++) the { - if(Val[i])Wuyisum++; the } -printf"%d\n", sum); Wu } - return 0; About}
View Code
HDU2015 School Race The country List