122412024-12-10 13:04:55TortelliniJrPontos Átlagcpp17Wrong answer 0/10043ms1492 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 << (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 answer1ms576 KiB
9Wrong answer1ms384 KiB
10Wrong answer1ms320 KiB
11Accepted1ms320 KiB
12Accepted1ms320 KiB
13Wrong answer1ms320 KiB
subtask30/40
14Accepted1ms320 KiB
15Accepted1ms320 KiB
16Wrong answer1ms320 KiB
17Partially correct1ms320 KiB
18Partially correct1ms560 KiB
19Partially correct2ms320 KiB
20Wrong answer1ms336 KiB
21Wrong answer1ms320 KiB
22Wrong answer1ms320 KiB
23Accepted1ms320 KiB
24Wrong answer1ms320 KiB
25Accepted1ms320 KiB
26Wrong answer1ms320 KiB
subtask40/40
27Accepted43ms1080 KiB
28Runtime error43ms1220 KiB
29Runtime error43ms1492 KiB
30Runtime error43ms1220 KiB
31Runtime error43ms1084 KiB
32Runtime error43ms1236 KiB
33Runtime error43ms1224 KiB
34Runtime error43ms1220 KiB
35Runtime error43ms1080 KiB
36Runtime error28ms1220 KiB
37Wrong answer41ms1084 KiB
38Wrong answer19ms1084 KiB
39Accepted41ms1080 KiB
40Accepted41ms1080 KiB
41Partially correct32ms1220 KiB
42Accepted41ms1080 KiB
43Wrong answer30ms1272 KiB