114272024-09-15 14:08:18CsongiPontos Átlagcpp17Wrong answer 60/10048ms2860 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n, k, sum = 0;
    cin >> n >> k;
    vector<int> q(n);
    for (int i = 0; i < n; i++)
    {
        cin >> q[i];
        sum += q[i];
    }

    if (sum < n * k)
    {
        cout << 1 << endl;
        return 0;
    }
    sort(q.begin(), q.end());
    int ki = 0;
    while (sum > n * k)
    {
        sum -= q.back() - 1;
        q.pop_back(); ki++;
    }
    cout << ki << endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted2ms360 KiB
2Accepted3ms504 KiB
subtask220/20
3Accepted3ms632 KiB
4Accepted3ms360 KiB
5Accepted3ms416 KiB
6Accepted3ms360 KiB
7Accepted3ms360 KiB
8Accepted3ms488 KiB
9Accepted3ms504 KiB
10Accepted3ms376 KiB
11Accepted3ms436 KiB
12Accepted3ms772 KiB
13Accepted3ms376 KiB
subtask340/40
14Accepted4ms420 KiB
15Accepted3ms360 KiB
16Accepted3ms496 KiB
17Accepted4ms524 KiB
18Accepted3ms488 KiB
19Accepted3ms504 KiB
20Accepted3ms360 KiB
21Accepted3ms764 KiB
22Accepted2ms376 KiB
23Accepted3ms504 KiB
24Accepted3ms396 KiB
25Accepted3ms504 KiB
26Accepted2ms360 KiB
subtask40/40
27Wrong answer48ms2552 KiB
28Partially correct48ms2564 KiB
29Wrong answer27ms2592 KiB
30Partially correct48ms2380 KiB
31Partially correct48ms2536 KiB
32Partially correct48ms2860 KiB
33Wrong answer27ms2588 KiB
34Partially correct46ms2680 KiB
35Partially correct46ms2536 KiB
36Wrong answer28ms2792 KiB
37Accepted48ms2600 KiB
38Accepted25ms1632 KiB
39Accepted46ms2460 KiB
40Accepted46ms2532 KiB
41Accepted35ms2064 KiB
42Accepted46ms2552 KiB
43Accepted34ms2024 KiB