11454 | 2024-09-29 12:24:10 | bzy | Pontos Átlag | cpp17 | Wrong answer 0/100 | 93ms | 1308 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k; cin >> n >> k;
int sum = 0;
int P[n]; for(int &p : P) cin >> p, sum += p;
if(k*n == sum) cout << 0 << "\n";
else if(k*n > sum) cout << 1 << "/n";
else{
int goal = sum - k*n;
sort(P,P+n);
int dif = 0;
int ans = 0;
for(int i = n-1; i >= 0; i--){
dif += P[i] - 1;
ans ++;
if(dif >= goal) break;
}
cout << ans << "\n";
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 2ms | 364 KiB | ||||
2 | Wrong answer | 2ms | 360 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Wrong answer | 3ms | 360 KiB | ||||
4 | Wrong answer | 3ms | 360 KiB | ||||
5 | Accepted | 2ms | 360 KiB | ||||
6 | Wrong answer | 3ms | 360 KiB | ||||
7 | Accepted | 2ms | 360 KiB | ||||
8 | Accepted | 2ms | 364 KiB | ||||
9 | Accepted | 2ms | 236 KiB | ||||
10 | Accepted | 2ms | 400 KiB | ||||
11 | Accepted | 2ms | 504 KiB | ||||
12 | Accepted | 3ms | 364 KiB | ||||
13 | Accepted | 3ms | 384 KiB | ||||
subtask3 | 0/40 | ||||||
14 | Wrong answer | 7ms | 256 KiB | ||||
15 | Accepted | 14ms | 488 KiB | ||||
16 | Accepted | 3ms | 360 KiB | ||||
17 | Accepted | 3ms | 360 KiB | ||||
18 | Accepted | 3ms | 256 KiB | ||||
19 | Accepted | 3ms | 504 KiB | ||||
20 | Accepted | 3ms | 376 KiB | ||||
21 | Accepted | 3ms | 376 KiB | ||||
22 | Accepted | 3ms | 236 KiB | ||||
23 | Accepted | 3ms | 384 KiB | ||||
24 | Accepted | 3ms | 368 KiB | ||||
25 | Accepted | 3ms | 384 KiB | ||||
26 | Accepted | 3ms | 360 KiB | ||||
subtask4 | 0/40 | ||||||
27 | Wrong answer | 93ms | 1296 KiB | ||||
28 | Partially correct | 93ms | 1184 KiB | ||||
29 | Wrong answer | 74ms | 1268 KiB | ||||
30 | Partially correct | 93ms | 1208 KiB | ||||
31 | Wrong answer | 93ms | 1156 KiB | ||||
32 | Partially correct | 93ms | 1128 KiB | ||||
33 | Wrong answer | 74ms | 1128 KiB | ||||
34 | Wrong answer | 93ms | 1128 KiB | ||||
35 | Partially correct | 93ms | 1308 KiB | ||||
36 | Wrong answer | 82ms | 1272 KiB | ||||
37 | Accepted | 74ms | 1128 KiB | ||||
38 | Accepted | 43ms | 1272 KiB | ||||
39 | Accepted | 90ms | 1168 KiB | ||||
40 | Accepted | 92ms | 1128 KiB | ||||
41 | Accepted | 68ms | 1256 KiB | ||||
42 | Accepted | 92ms | 1128 KiB | ||||
43 | Accepted | 63ms | 1000 KiB |