AcWing 781. 趣味字母卡片
原题链接
简单
作者:
火影飞人
,
2019-09-27 15:17:05
,
所有人可见
,
阅读 823
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<cmath>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<cstring>
#include<queue>
#include<stack>
#include<list>
#include<limits.h>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
int main()
{
string in;
cin >> in;
vector<int> hash(26);
for (auto &c : in)
{
c = tolower(c);
hash[c - 'a']++;
}
int res = in[0]-'a';
for (int i = 0; i < in.size(); i++)
{
res = min(res, in[i] - 'a');
if (hash[in[i] - 'a'] == 1) break;
hash[in[i] - 'a']--;
}
cout << char('a' + res);
}
模板
为什么要写这么多头文件