int n, a[100001], b[10];
int main() {
cin >> n;
int max1 = 0;
for (int i = 0; i < n; i++)
{
cin >> a[i];
if (a[i] > a[max1])
{
max1 = i;
}
}
for (int i = 0; i < n; i++)
{
b[a[i]]++;
}
int max = 0;
for (int i = 0; i <= a[max1]; i++)
{
if (b[i] > b[max])
{
max = i;
}
}
cout << max;
return 0;
}
洛谷B2097 最长平台
最新推荐文章于 2024-03-14 19:27:51 发布