#include using namespace std; int main(){ int n; cin >> n; //vector types(n); int a[n], m[n][2] = {1}, total = 0; for(int types_i = 0; types_i < n; types_i++){ cin >> a[types_i]; } // your code goes here sort(a,a+n); int mode = n-1; double max =0; for (int i=0,j=0; i max) { mode = j; max = m[j][1]; } } else { m[j][0] = a[i]; j +=1; } } cout.precision(0); if (mode != (n-1) ) cout << fixed << m[mode][0]; else cout << fixed << m[0][0]; return 0; }