#include <iostream>
#include <map>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
map<string, int>m;
int N; cin >> N;
while (N--) {
string s; cin >> s;
m[s]++;
}
int ans = 0;
for (auto i = m.begin(); i != m.end(); i++) {
ans = max(ans, i->second); //๊ฐ์ฅ ํฐ ๊ฐ ์ฐพ๊ธฐ
}
for (auto k = m.begin(); k != m.end(); k++) {
if (ans == k->second) { //๊ฐ์ฅ ํฐ ๊ฐ์ด ์๋ ์์น ์ฐพ๊ธฐ
cout << k->first;
return 0;
}
}
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 13163๋ฒ - ๋๋ค์์ ๊ฐ ๋ถ์ด๊ธฐ (0) | 2021.11.04 |
---|---|
[๋ฐฑ์ค,c++] 1316๋ฒ - ๊ทธ๋ฃน ๋จ์ด ์ฒด์ปค (0) | 2021.11.04 |
[๋ฐฑ์ค,c++] 13023๋ฒ - ABCDE (0) | 2021.11.04 |
[๋ฐฑ์ค,c++] 1292๋ฒ - ์ฝ๊ฒ ํธ๋ ๋ฌธ์ (0) | 2021.11.04 |
[๋ฐฑ์ค,c++] 12851๋ฒ - ์จ๋ฐ๊ผญ์ง2 (0) | 2021.11.04 |
[๋ฐฑ์ค,c++] 12813๋ฒ - ์ด์ง์ ์ฐ์ฐ (0) | 2021.11.02 |
๋๊ธ