0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

B - Election

https://atcoder.jp/contests/abc231/submissions/27821390
This commit is contained in:
Baoshuo Ren 2021-12-11 20:06:23 +08:00
parent 0678e7c2fd
commit f50c87b73c
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

27
AtCoder/ABC231/B/B.cpp Normal file
View File

@ -0,0 +1,27 @@
#include <iostream>
#include <map>
#include <string>
using std::cin;
using std::cout;
using std::endl;
int n;
std::string s;
std::map<std::string, int> m;
std::pair<std::string, int> ans;
int main() {
cin >> n;
while (n--) {
cin >> s;
m[s]++;
}
for (auto i : m) {
if (i.second > ans.second) {
ans = i;
}
}
cout << ans.first << endl;
return 0;
}