6707 | 2023-12-17 18:08:38 | MagyarKendeSZLG | Pontos Átlag | cpp17 | Wrong answer 0/100 | 52ms | 5492 KiB |
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, K, sum;
cin >> N >> K;
vector<int> P(N);
for (int i = 0; i < N; i++) {
cin >> P[i];
sum += P[i];
}
sort(P.begin(), P.end());
const int prod = N * K;
if (prod == sum) {
cout << 0;
} else if (prod > sum) {
cout << 1;
} else {
for (int i = N - 1, result = 0; i >= 0; i--) {
sum -= P[i] - 1;
result++;
if (prod >= sum) {
cout << result;
}
}
}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1832 KiB | ||||
2 | Wrong answer | 3ms | 2032 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Accepted | 3ms | 2396 KiB | ||||
4 | Wrong answer | 3ms | 2448 KiB | ||||
5 | Wrong answer | 3ms | 2552 KiB | ||||
6 | Accepted | 3ms | 2636 KiB | ||||
7 | Accepted | 3ms | 2748 KiB | ||||
8 | Wrong answer | 3ms | 2852 KiB | ||||
9 | Wrong answer | 3ms | 2952 KiB | ||||
10 | Wrong answer | 3ms | 3060 KiB | ||||
11 | Wrong answer | 3ms | 3152 KiB | ||||
12 | Wrong answer | 3ms | 3376 KiB | ||||
13 | Accepted | 3ms | 3416 KiB | ||||
subtask3 | 0/40 | ||||||
14 | Accepted | 3ms | 3508 KiB | ||||
15 | Wrong answer | 3ms | 3632 KiB | ||||
16 | Accepted | 3ms | 3708 KiB | ||||
17 | Wrong answer | 3ms | 3704 KiB | ||||
18 | Wrong answer | 3ms | 3708 KiB | ||||
19 | Wrong answer | 3ms | 3940 KiB | ||||
20 | Wrong answer | 3ms | 3924 KiB | ||||
21 | Wrong answer | 3ms | 3916 KiB | ||||
22 | Accepted | 3ms | 3916 KiB | ||||
23 | Wrong answer | 3ms | 4016 KiB | ||||
24 | Accepted | 3ms | 4256 KiB | ||||
25 | Wrong answer | 3ms | 4236 KiB | ||||
26 | Wrong answer | 3ms | 4100 KiB | ||||
subtask4 | 0/40 | ||||||
27 | Wrong answer | 52ms | 5492 KiB | ||||
28 | Wrong answer | 52ms | 5432 KiB | ||||
29 | Wrong answer | 46ms | 5364 KiB | ||||
30 | Wrong answer | 46ms | 5248 KiB | ||||
31 | Wrong answer | 50ms | 5312 KiB | ||||
32 | Wrong answer | 50ms | 5316 KiB | ||||
33 | Wrong answer | 48ms | 5324 KiB | ||||
34 | Wrong answer | 48ms | 5324 KiB | ||||
35 | Wrong answer | 46ms | 5484 KiB | ||||
36 | Wrong answer | 39ms | 5424 KiB | ||||
37 | Wrong answer | 48ms | 5396 KiB | ||||
38 | Wrong answer | 23ms | 5372 KiB | ||||
39 | Wrong answer | 52ms | 5436 KiB | ||||
40 | Wrong answer | 52ms | 5448 KiB | ||||
41 | Wrong answer | 35ms | 5248 KiB | ||||
42 | Accepted | 46ms | 5252 KiB | ||||
43 | Wrong answer | 34ms | 5252 KiB |