12240 | 2024-12-10 13:02:30 | TortelliniJr | Pontos Átlag | cpp17 | Wrong answer 0/100 | 43ms | 1420 KiB |
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(false); // THE FEELING WHEN
cin.tie(nullptr); // YOU HAVE KNEE SURGERY TOMORROW
int N, K; int M = 0;
cin >> N >> K;
vector<int> P(N);
for (int i = 0; i < N; ++i) {
cin >> P[i];
M += P[i];
}
int ans = 0;
int rans = 0;
sort(P.begin(), P.end());
while ((M - ans) / N > K)
{
ans += P[P.size() - 1] - 1;
rans++;
P.pop_back();
}
cout << (rans + 1) << endl;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 1ms | 320 KiB | ||||
2 | Accepted | 1ms | 320 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Accepted | 1ms | 320 KiB | ||||
4 | Accepted | 1ms | 320 KiB | ||||
5 | Wrong answer | 1ms | 320 KiB | ||||
6 | Accepted | 1ms | 320 KiB | ||||
7 | Wrong answer | 1ms | 320 KiB | ||||
8 | Wrong answer | 1ms | 320 KiB | ||||
9 | Wrong answer | 1ms | 320 KiB | ||||
10 | Wrong answer | 1ms | 320 KiB | ||||
11 | Accepted | 1ms | 320 KiB | ||||
12 | Accepted | 1ms | 320 KiB | ||||
13 | Wrong answer | 1ms | 372 KiB | ||||
subtask3 | 0/40 | ||||||
14 | Accepted | 1ms | 320 KiB | ||||
15 | Accepted | 1ms | 320 KiB | ||||
16 | Wrong answer | 1ms | 320 KiB | ||||
17 | Partially correct | 1ms | 320 KiB | ||||
18 | Partially correct | 1ms | 320 KiB | ||||
19 | Partially correct | 1ms | 384 KiB | ||||
20 | Wrong answer | 1ms | 320 KiB | ||||
21 | Wrong answer | 1ms | 356 KiB | ||||
22 | Wrong answer | 1ms | 320 KiB | ||||
23 | Accepted | 1ms | 320 KiB | ||||
24 | Wrong answer | 1ms | 320 KiB | ||||
25 | Accepted | 1ms | 320 KiB | ||||
26 | Accepted | 1ms | 320 KiB | ||||
subtask4 | 0/40 | ||||||
27 | Accepted | 43ms | 1080 KiB | ||||
28 | Wrong answer | 43ms | 1228 KiB | ||||
29 | Wrong answer | 41ms | 1080 KiB | ||||
30 | Wrong answer | 41ms | 1080 KiB | ||||
31 | Wrong answer | 43ms | 1336 KiB | ||||
32 | Wrong answer | 43ms | 1080 KiB | ||||
33 | Wrong answer | 43ms | 1080 KiB | ||||
34 | Wrong answer | 43ms | 1080 KiB | ||||
35 | Wrong answer | 43ms | 1080 KiB | ||||
36 | Wrong answer | 27ms | 1272 KiB | ||||
37 | Wrong answer | 43ms | 1080 KiB | ||||
38 | Wrong answer | 19ms | 1420 KiB | ||||
39 | Wrong answer | 41ms | 1224 KiB | ||||
40 | Accepted | 41ms | 1080 KiB | ||||
41 | Wrong answer | 32ms | 1080 KiB | ||||
42 | Accepted | 41ms | 1224 KiB | ||||
43 | Accepted | 29ms | 1080 KiB |