#include <cstdio>
#include <map>
using namespace std;
int main(){
int n,tot,max=0;
map<char,int> mp;
char a[210];
scanf("%d",&n);
scanf("%s",a);
for(int i=0;i<n;i++){
if(a[i]>=‘a‘&&a[i]<=‘z‘){
mp.clear();
tot=1;
mp[a[i]]++;
i++;
while(a[i]>=‘a‘&&a[i]<=‘z‘){
if(!mp.count(a[i])){
tot++;
mp[a[i]]++;
}
i++;
}
//printf("%d\n",tot);
if(tot>max) max=tot;
}
}
printf("%d\n",max);
return 0;
}
Codeforces Round #436 (Div. 2), problem: (B) Polycarp and Letters
原文:http://www.cnblogs.com/LMissher/p/7622174.html