#include <bits/stdc++.h>
using namespace std;
map<int, int>times;
int main() {
int n, maxx = 0;
cin >> n;
for(int i = 0; i < n; i++){
int temp;
cin >> temp;
times[temp]++;
maxx = max(maxx, times[temp]);
}
cout << min(maxx + 1, n);
}
// 64 位输出请用 printf("%lld")
直接读入, 利用map来储存每个字母出现的次数(比数组好使), 输出的句子是为了避免所有的数字都是同一数字, 没法修改的情况, 其余情况都是最大值+1就好。

京公网安备 11010502036488号