122432024-12-10 13:06:31TortelliniJrPontos Átlagcpp17Wrong answer 0/10043ms1480 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

    float N, K; float 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];
        rans++;
        P.pop_back();
    }

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

    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms320 KiB
2Accepted1ms508 KiB
subtask20/20
3Accepted1ms320 KiB
4Accepted1ms320 KiB
5Wrong answer1ms508 KiB
6Accepted1ms320 KiB
7Wrong answer1ms508 KiB
8Wrong answer1ms512 KiB
9Wrong answer1ms320 KiB
10Wrong answer1ms552 KiB
11Accepted1ms320 KiB
12Accepted1ms320 KiB
13Wrong answer1ms320 KiB
subtask30/40
14Accepted1ms320 KiB
15Accepted1ms320 KiB
16Wrong answer1ms320 KiB
17Partially correct1ms320 KiB
18Partially correct1ms320 KiB
19Partially correct1ms320 KiB
20Wrong answer1ms320 KiB
21Wrong answer1ms500 KiB
22Wrong answer1ms320 KiB
23Accepted1ms320 KiB
24Wrong answer1ms320 KiB
25Accepted1ms320 KiB
26Wrong answer1ms320 KiB
subtask40/40
27Accepted43ms1224 KiB
28Runtime error43ms1480 KiB
29Runtime error43ms1224 KiB
30Runtime error43ms1220 KiB
31Runtime error43ms1080 KiB
32Runtime error43ms1268 KiB
33Runtime error43ms1080 KiB
34Runtime error43ms1220 KiB
35Runtime error43ms1080 KiB
36Runtime error28ms1080 KiB
37Wrong answer43ms1080 KiB
38Wrong answer19ms1080 KiB
39Accepted41ms1264 KiB
40Accepted41ms1080 KiB
41Partially correct32ms1228 KiB
42Accepted41ms1080 KiB
43Wrong answer29ms1080 KiB