• + 0 comments

    include

    using namespace std; int test(int n, vector a){ unordered_map v; for(int it : a){ v[it]++; } int max_value = 0; for(auto& pair : v){ max_value = max(max_value, pair.second); } return n - max_value; } int main(){ int n; cin >> n; vector a(n); for(int i = 0; i < n; i++){ cin >> a[i]; } cout << test(n, a) << endl; return 0; }