11522 | 2024-10-19 09:36:08 | Dávid | Pontos Átlag | cpp17 | Wrong answer 60/100 | 97ms | 2592 KiB |
#include <bits/stdc++.h>
#include <vector>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> arak(n);
int osszeg = 0;
for(int i = 0; i < n; i++) {
cin >> arak[i];
osszeg += arak[i];
}
if(osszeg < n * k) {
cout << 1 << endl;
return 0;
}
sort(arak.rbegin(), arak.rend());
int eredmeny = 0;
for(int i = 0; i < n; i++) {
if(osszeg > n * k) {
osszeg -= min(arak[i] - 1, osszeg - n * k);
eredmeny++;
}
}
cout << eredmeny << endl;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 1ms | 320 KiB | ||||
2 | Accepted | 1ms | 320 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 1ms | 320 KiB | ||||
4 | Accepted | 1ms | 320 KiB | ||||
5 | Accepted | 1ms | 508 KiB | ||||
6 | Accepted | 1ms | 320 KiB | ||||
7 | Accepted | 1ms | 320 KiB | ||||
8 | Accepted | 1ms | 412 KiB | ||||
9 | Accepted | 1ms | 320 KiB | ||||
10 | Accepted | 1ms | 320 KiB | ||||
11 | Accepted | 1ms | 320 KiB | ||||
12 | Accepted | 1ms | 320 KiB | ||||
13 | Accepted | 1ms | 320 KiB | ||||
subtask3 | 40/40 | ||||||
14 | Accepted | 1ms | 320 KiB | ||||
15 | Accepted | 1ms | 320 KiB | ||||
16 | Accepted | 1ms | 320 KiB | ||||
17 | Accepted | 1ms | 568 KiB | ||||
18 | Accepted | 1ms | 320 KiB | ||||
19 | Accepted | 1ms | 320 KiB | ||||
20 | Accepted | 1ms | 320 KiB | ||||
21 | Accepted | 1ms | 320 KiB | ||||
22 | Accepted | 1ms | 408 KiB | ||||
23 | Accepted | 1ms | 412 KiB | ||||
24 | Accepted | 1ms | 560 KiB | ||||
25 | Accepted | 1ms | 320 KiB | ||||
26 | Accepted | 1ms | 320 KiB | ||||
subtask4 | 0/40 | ||||||
27 | Wrong answer | 93ms | 2344 KiB | ||||
28 | Partially correct | 94ms | 2348 KiB | ||||
29 | Wrong answer | 72ms | 2464 KiB | ||||
30 | Partially correct | 93ms | 2472 KiB | ||||
31 | Wrong answer | 94ms | 2340 KiB | ||||
32 | Partially correct | 97ms | 2472 KiB | ||||
33 | Wrong answer | 72ms | 2344 KiB | ||||
34 | Wrong answer | 94ms | 2360 KiB | ||||
35 | Partially correct | 94ms | 2360 KiB | ||||
36 | Wrong answer | 81ms | 2592 KiB | ||||
37 | Accepted | 93ms | 2344 KiB | ||||
38 | Accepted | 43ms | 1444 KiB | ||||
39 | Accepted | 90ms | 2360 KiB | ||||
40 | Accepted | 93ms | 2464 KiB | ||||
41 | Accepted | 70ms | 1844 KiB | ||||
42 | Accepted | 93ms | 2356 KiB | ||||
43 | Accepted | 64ms | 1848 KiB |