11428 | 2024-09-15 14:24:24 | Csongi | Pontos Átlag | cpp17 | Wrong answer 0/100 | 45ms | 1400 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
long long int n, k, sum = 0;
cin >> n >> k;
vector<int> q(n);
long long int sum2 = n*k;
for (int i = 0; i < n; i++)
{
cin >> q[i];
sum += q[i];
}
if (sum < sum2)
{
cout << 1 << endl;
return 0;
}
sort(q.begin(), q.end());
int ki = 0;
while (sum > sum2)
{
sum -= q.back();
sum--;
q.pop_back(); ki++;
}
cout << ki << endl;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 504 KiB | ||||
2 | Accepted | 3ms | 360 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Accepted | 3ms | 540 KiB | ||||
4 | Accepted | 3ms | 440 KiB | ||||
5 | Accepted | 3ms | 492 KiB | ||||
6 | Accepted | 2ms | 508 KiB | ||||
7 | Accepted | 2ms | 504 KiB | ||||
8 | Accepted | 3ms | 500 KiB | ||||
9 | Accepted | 3ms | 360 KiB | ||||
10 | Accepted | 2ms | 360 KiB | ||||
11 | Wrong answer | 2ms | 376 KiB | ||||
12 | Wrong answer | 3ms | 500 KiB | ||||
13 | Accepted | 2ms | 360 KiB | ||||
subtask3 | 0/40 | ||||||
14 | Accepted | 3ms | 360 KiB | ||||
15 | Partially correct | 3ms | 548 KiB | ||||
16 | Accepted | 3ms | 488 KiB | ||||
17 | Accepted | 3ms | 400 KiB | ||||
18 | Accepted | 2ms | 504 KiB | ||||
19 | Accepted | 3ms | 360 KiB | ||||
20 | Accepted | 3ms | 360 KiB | ||||
21 | Accepted | 3ms | 360 KiB | ||||
22 | Accepted | 3ms | 500 KiB | ||||
23 | Wrong answer | 3ms | 232 KiB | ||||
24 | Accepted | 3ms | 504 KiB | ||||
25 | Wrong answer | 3ms | 376 KiB | ||||
26 | Accepted | 3ms | 376 KiB | ||||
subtask4 | 0/40 | ||||||
27 | Accepted | 25ms | 1400 KiB | ||||
28 | Partially correct | 45ms | 1128 KiB | ||||
29 | Accepted | 45ms | 1088 KiB | ||||
30 | Accepted | 43ms | 1272 KiB | ||||
31 | Accepted | 43ms | 1272 KiB | ||||
32 | Accepted | 45ms | 1144 KiB | ||||
33 | Partially correct | 43ms | 1128 KiB | ||||
34 | Partially correct | 43ms | 1164 KiB | ||||
35 | Partially correct | 45ms | 1236 KiB | ||||
36 | Accepted | 28ms | 1084 KiB | ||||
37 | Accepted | 45ms | 1144 KiB | ||||
38 | Accepted | 20ms | 1144 KiB | ||||
39 | Wrong answer | 43ms | 1272 KiB | ||||
40 | Accepted | 43ms | 1244 KiB | ||||
41 | Wrong answer | 34ms | 1256 KiB | ||||
42 | Accepted | 43ms | 1128 KiB | ||||
43 | Accepted | 30ms | 1272 KiB |