unordered_multiset求助
查看原帖
unordered_multiset求助
256340
Miller2019楼主2020/7/27 17:31

正解写完后写完后,随便写了个 unordered_multisetunordered\_multiset,结果本地样例过了,ide T了,CF W了。。。刚刚自学的这玩意儿 (((

#include<cstdio>
#include<cctype>
#include<unordered_set>
std::unordered_multiset<char>str;
char c;
int main()
{
 	while(scanf("%c",&c),islower(c))
	{
		str.insert(c);
	}
	printf("%llu",std::min(str.size(),str.count('a')*2-1));
	return 0;
}
2020/7/27 17:31
加载中...