12243 | 2024-12-10 13:06:31 | TortelliniJr | Pontos Átlag | cpp17 | Wrong answer 0/100 | 43ms | 1480 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
float N, K; float 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];
rans++;
P.pop_back();
}
cout << int(rans + 1) << endl;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 1ms | 320 KiB | ||||
2 | Accepted | 1ms | 508 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Accepted | 1ms | 320 KiB | ||||
4 | Accepted | 1ms | 320 KiB | ||||
5 | Wrong answer | 1ms | 508 KiB | ||||
6 | Accepted | 1ms | 320 KiB | ||||
7 | Wrong answer | 1ms | 508 KiB | ||||
8 | Wrong answer | 1ms | 512 KiB | ||||
9 | Wrong answer | 1ms | 320 KiB | ||||
10 | Wrong answer | 1ms | 552 KiB | ||||
11 | Accepted | 1ms | 320 KiB | ||||
12 | Accepted | 1ms | 320 KiB | ||||
13 | Wrong answer | 1ms | 320 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 | 320 KiB | ||||
20 | Wrong answer | 1ms | 320 KiB | ||||
21 | Wrong answer | 1ms | 500 KiB | ||||
22 | Wrong answer | 1ms | 320 KiB | ||||
23 | Accepted | 1ms | 320 KiB | ||||
24 | Wrong answer | 1ms | 320 KiB | ||||
25 | Accepted | 1ms | 320 KiB | ||||
26 | Wrong answer | 1ms | 320 KiB | ||||
subtask4 | 0/40 | ||||||
27 | Accepted | 43ms | 1224 KiB | ||||
28 | Runtime error | 43ms | 1480 KiB | ||||
29 | Runtime error | 43ms | 1224 KiB | ||||
30 | Runtime error | 43ms | 1220 KiB | ||||
31 | Runtime error | 43ms | 1080 KiB | ||||
32 | Runtime error | 43ms | 1268 KiB | ||||
33 | Runtime error | 43ms | 1080 KiB | ||||
34 | Runtime error | 43ms | 1220 KiB | ||||
35 | Runtime error | 43ms | 1080 KiB | ||||
36 | Runtime error | 28ms | 1080 KiB | ||||
37 | Wrong answer | 43ms | 1080 KiB | ||||
38 | Wrong answer | 19ms | 1080 KiB | ||||
39 | Accepted | 41ms | 1264 KiB | ||||
40 | Accepted | 41ms | 1080 KiB | ||||
41 | Partially correct | 32ms | 1228 KiB | ||||
42 | Accepted | 41ms | 1080 KiB | ||||
43 | Wrong answer | 29ms | 1080 KiB |