11427 | 2024-09-15 14:08:18 | Csongi | Pontos Átlag | cpp17 | Wrong answer 60/100 | 48ms | 2860 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 2ms | 360 KiB | ||||
2 | Accepted | 3ms | 504 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 3ms | 632 KiB | ||||
4 | Accepted | 3ms | 360 KiB | ||||
5 | Accepted | 3ms | 416 KiB | ||||
6 | Accepted | 3ms | 360 KiB | ||||
7 | Accepted | 3ms | 360 KiB | ||||
8 | Accepted | 3ms | 488 KiB | ||||
9 | Accepted | 3ms | 504 KiB | ||||
10 | Accepted | 3ms | 376 KiB | ||||
11 | Accepted | 3ms | 436 KiB | ||||
12 | Accepted | 3ms | 772 KiB | ||||
13 | Accepted | 3ms | 376 KiB | ||||
subtask3 | 40/40 | ||||||
14 | Accepted | 4ms | 420 KiB | ||||
15 | Accepted | 3ms | 360 KiB | ||||
16 | Accepted | 3ms | 496 KiB | ||||
17 | Accepted | 4ms | 524 KiB | ||||
18 | Accepted | 3ms | 488 KiB | ||||
19 | Accepted | 3ms | 504 KiB | ||||
20 | Accepted | 3ms | 360 KiB | ||||
21 | Accepted | 3ms | 764 KiB | ||||
22 | Accepted | 2ms | 376 KiB | ||||
23 | Accepted | 3ms | 504 KiB | ||||
24 | Accepted | 3ms | 396 KiB | ||||
25 | Accepted | 3ms | 504 KiB | ||||
26 | Accepted | 2ms | 360 KiB | ||||
subtask4 | 0/40 | ||||||
27 | Wrong answer | 48ms | 2552 KiB | ||||
28 | Partially correct | 48ms | 2564 KiB | ||||
29 | Wrong answer | 27ms | 2592 KiB | ||||
30 | Partially correct | 48ms | 2380 KiB | ||||
31 | Partially correct | 48ms | 2536 KiB | ||||
32 | Partially correct | 48ms | 2860 KiB | ||||
33 | Wrong answer | 27ms | 2588 KiB | ||||
34 | Partially correct | 46ms | 2680 KiB | ||||
35 | Partially correct | 46ms | 2536 KiB | ||||
36 | Wrong answer | 28ms | 2792 KiB | ||||
37 | Accepted | 48ms | 2600 KiB | ||||
38 | Accepted | 25ms | 1632 KiB | ||||
39 | Accepted | 46ms | 2460 KiB | ||||
40 | Accepted | 46ms | 2532 KiB | ||||
41 | Accepted | 35ms | 2064 KiB | ||||
42 | Accepted | 46ms | 2552 KiB | ||||
43 | Accepted | 34ms | 2024 KiB |