码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-10-02 20:21:18      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:com   std   scan   main   code   span   char   pac   turn   

#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

标签:com   std   scan   main   code   span   char   pac   turn   

原文地址:http://www.cnblogs.com/LMissher/p/7622174.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!