12241 | 2024-12-10 13:04:55 | TortelliniJr | Pontos Átlag | cpp17 | Wrong answer 0/100 | 43ms | 1492 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 << (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 | 576 KiB | ||||
9 | Wrong answer | 1ms | 384 KiB | ||||
10 | Wrong answer | 1ms | 320 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 | 560 KiB | ||||
19 | Partially correct | 2ms | 320 KiB | ||||
20 | Wrong answer | 1ms | 336 KiB | ||||
21 | Wrong answer | 1ms | 320 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 | 1080 KiB | ||||
28 | Runtime error | 43ms | 1220 KiB | ||||
29 | Runtime error | 43ms | 1492 KiB | ||||
30 | Runtime error | 43ms | 1220 KiB | ||||
31 | Runtime error | 43ms | 1084 KiB | ||||
32 | Runtime error | 43ms | 1236 KiB | ||||
33 | Runtime error | 43ms | 1224 KiB | ||||
34 | Runtime error | 43ms | 1220 KiB | ||||
35 | Runtime error | 43ms | 1080 KiB | ||||
36 | Runtime error | 28ms | 1220 KiB | ||||
37 | Wrong answer | 41ms | 1084 KiB | ||||
38 | Wrong answer | 19ms | 1084 KiB | ||||
39 | Accepted | 41ms | 1080 KiB | ||||
40 | Accepted | 41ms | 1080 KiB | ||||
41 | Partially correct | 32ms | 1220 KiB | ||||
42 | Accepted | 41ms | 1080 KiB | ||||
43 | Wrong answer | 30ms | 1272 KiB |