Codeforces Round #436 (Div. 2), problem: (B) Polycarp and Letters

Posted LMissher

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Codeforces Round #436 (Div. 2), problem: (B) Polycarp and Letters相关的知识,希望对你有一定的参考价值。

#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的主要内容,如果未能解决你的问题,请参考以下文章

Codeforces Round #436 E

Codeforces Round #436 (Div. 2)

[Codeforces] Round #436 (Div. 2)

Codeforces Round #436 (Div. 2)ABCDE

Codeforces Round #436 C. Bus

Codeforces Round #436 A. Fair Game