114532024-09-29 12:22:35bzyPontos Átlagcpp17Wrong answer 0/10093ms1396 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms396 KiB
2Wrong answer3ms360 KiB
subtask20/20
3Wrong answer2ms504 KiB
4Wrong answer3ms488 KiB
5Accepted2ms232 KiB
6Wrong answer3ms504 KiB
7Accepted2ms384 KiB
8Accepted3ms360 KiB
9Accepted2ms384 KiB
10Accepted2ms360 KiB
11Accepted2ms360 KiB
12Accepted3ms360 KiB
13Wrong answer2ms376 KiB
subtask30/40
14Wrong answer3ms256 KiB
15Accepted3ms360 KiB
16Accepted3ms304 KiB
17Accepted3ms256 KiB
18Accepted3ms360 KiB
19Accepted3ms496 KiB
20Accepted3ms360 KiB
21Accepted3ms492 KiB
22Accepted3ms232 KiB
23Accepted3ms384 KiB
24Wrong answer3ms504 KiB
25Accepted3ms292 KiB
26Wrong answer3ms504 KiB
subtask40/40
27Wrong answer93ms1048 KiB
28Partially correct93ms1044 KiB
29Wrong answer74ms1024 KiB
30Partially correct93ms1040 KiB
31Wrong answer93ms1168 KiB
32Partially correct93ms1128 KiB
33Wrong answer75ms1272 KiB
34Wrong answer93ms1128 KiB
35Partially correct93ms1128 KiB
36Wrong answer82ms1128 KiB
37Accepted74ms1396 KiB
38Accepted43ms1128 KiB
39Accepted90ms1168 KiB
40Wrong answer93ms1168 KiB
41Accepted68ms1272 KiB
42Wrong answer93ms1256 KiB
43Wrong answer64ms1168 KiB