按题意直接模拟即可。

AC code:

#include <bits/stdc++.h>
using namespace std;

int main() {
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n;
    cin >> n;
    vector<long long> r(n);
    for (int i = 0; i < n; ++i) {
        cin >> r[i];
    }
    sort(r.begin(), r.end());
    int left = 0, count = 0;
    for (int j = 1; j < n; ++j) {
        if (r[j] > r[left]) {
            ++left;
            ++count;
        }
    }
    cout << n - count << endl;
    return 0;
}