122402024-12-10 13:02:30TortelliniJrPontos Átlagcpp17Wrong answer 0/10043ms1420 KiB
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    ios::sync_with_stdio(false); // THE FEELING WHEN
    cin.tie(nullptr); // YOU HAVE KNEE SURGERY TOMORROW

    int N, K; int M = 0;
    cin >> N >> K;

    vector<int> P(N);
    for (int i = 0; i < N; ++i) {
        cin >> P[i];
        M += P[i];
    }
    int ans = 0;
    int rans = 0;
    sort(P.begin(), P.end());
    while ((M - ans) / N > K)
    {
        ans += P[P.size() - 1] - 1;
        rans++;
        P.pop_back();
    }

    cout << (rans + 1) << endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms320 KiB
2Accepted1ms320 KiB
subtask20/20
3Accepted1ms320 KiB
4Accepted1ms320 KiB
5Wrong answer1ms320 KiB
6Accepted1ms320 KiB
7Wrong answer1ms320 KiB
8Wrong answer1ms320 KiB
9Wrong answer1ms320 KiB
10Wrong answer1ms320 KiB
11Accepted1ms320 KiB
12Accepted1ms320 KiB
13Wrong answer1ms372 KiB
subtask30/40
14Accepted1ms320 KiB
15Accepted1ms320 KiB
16Wrong answer1ms320 KiB
17Partially correct1ms320 KiB
18Partially correct1ms320 KiB
19Partially correct1ms384 KiB
20Wrong answer1ms320 KiB
21Wrong answer1ms356 KiB
22Wrong answer1ms320 KiB
23Accepted1ms320 KiB
24Wrong answer1ms320 KiB
25Accepted1ms320 KiB
26Accepted1ms320 KiB
subtask40/40
27Accepted43ms1080 KiB
28Wrong answer43ms1228 KiB
29Wrong answer41ms1080 KiB
30Wrong answer41ms1080 KiB
31Wrong answer43ms1336 KiB
32Wrong answer43ms1080 KiB
33Wrong answer43ms1080 KiB
34Wrong answer43ms1080 KiB
35Wrong answer43ms1080 KiB
36Wrong answer27ms1272 KiB
37Wrong answer43ms1080 KiB
38Wrong answer19ms1420 KiB
39Wrong answer41ms1224 KiB
40Accepted41ms1080 KiB
41Wrong answer32ms1080 KiB
42Accepted41ms1224 KiB
43Accepted29ms1080 KiB