Pagini recente » Cod sursa (job #2017561) | Cod sursa (job #591269) | Cod sursa (job #2861737) | Cod sursa (job #1748708) | Cod sursa (job #1049148)
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream cin("elmaj.in");
ofstream cout("elmaj.out");
int n, i, x, a, b;
unordered_map<int, int> h;
unordered_map<int, int>::iterator it;
int main()
{
cin>>n;
for(i=1; i<=n; i++)
{
cin>>x;
h[x]++;
}
for(it=h.begin(); it!h.end(); it++)
if((it->second)>b)
{
a=it->first;
b=it->second;
}
cout<<a<<" "<<b;
return 0;
}