Submission #2212218


Source Code Expand

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

int main(void) {
    int n, k, ans = 0;
    map<int, int> ball;
    vector<int> count;
    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        if (!ball[a]) ball[a] = 1;
        else ball[a]++;
    }
    for (auto it = ball.begin(); it != ball.end(); it++)
        count.push_back(it->second);
    sort(count.begin(), count.end());
    for (int i = 0; i < ball.size() - k; i++)
        ans += count[i];
    cout << ans << endl;
}

Submission Info

Submission Time
Task C - Not so Diverse
User zohe
Language C++14 (GCC 5.4.1)
Score 0
Code Size 536 Byte
Status RE
Exec Time 177 ms
Memory 10748 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
RE × 1
AC × 14
RE × 5
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt
All sample1.txt, sample2.txt, sample3.txt, 1.txt, 10.txt, 11.txt, 12.txt, 13.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt
Case Name Status Exec Time Memory
1.txt AC 1 ms 256 KB
10.txt AC 65 ms 256 KB
11.txt AC 71 ms 256 KB
12.txt AC 165 ms 10748 KB
13.txt RE 177 ms 384 KB
2.txt AC 1 ms 256 KB
3.txt AC 67 ms 256 KB
4.txt AC 85 ms 384 KB
5.txt AC 84 ms 384 KB
6.txt RE 175 ms 384 KB
7.txt AC 57 ms 256 KB
8.txt RE 153 ms 256 KB
9.txt AC 104 ms 1152 KB
sample1.txt AC 1 ms 256 KB
sample2.txt RE 96 ms 256 KB
sample3.txt AC 1 ms 256 KB