Pagini recente » Cod sursa (job #31147) | Cod sursa (job #100904) | Cod sursa (job #2808950) | Profil RolandPetrean | Cod sursa (job #3227372)
#include<bits/stdc++.h>
auto in = std::freopen("elmaj.in" , "r" , stdin);
auto out = std::freopen("elmaj.out" , "w" , stdout);
#include<bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
gp_hash_table<int,int> ht;
int main(){
int n,x;
std::cin >> n;
std::pair<int,int> ans;
while(n--){
std::cin >> x;
ht[x]++;
if(ht[x] > ans.second){
ans = {x, ht[x]};
}
}
std::cout << ans.first <<' ' << ans.second;
return 0;
}