#include using namespace std; int main(){ int n, type; cin >> n; maptypes; for(int types_i = 0; types_i < n; types_i++){ cin >> type; types[type] += 1; } map::iterator iter = types.begin(); map::iterator mostFrequent = iter; for (iter; iter != types.end(); iter++){ if (iter->second > mostFrequent->second){ mostFrequent = iter; } } printf("%d", mostFrequent->first); // your code goes here return 0; }