114542024-09-29 12:24:10bzyPontos Átlagcpp17Wrong answer 0/10093ms1308 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
1Accepted2ms364 KiB
2Wrong answer2ms360 KiB
subtask20/20
3Wrong answer3ms360 KiB
4Wrong answer3ms360 KiB
5Accepted2ms360 KiB
6Wrong answer3ms360 KiB
7Accepted2ms360 KiB
8Accepted2ms364 KiB
9Accepted2ms236 KiB
10Accepted2ms400 KiB
11Accepted2ms504 KiB
12Accepted3ms364 KiB
13Accepted3ms384 KiB
subtask30/40
14Wrong answer7ms256 KiB
15Accepted14ms488 KiB
16Accepted3ms360 KiB
17Accepted3ms360 KiB
18Accepted3ms256 KiB
19Accepted3ms504 KiB
20Accepted3ms376 KiB
21Accepted3ms376 KiB
22Accepted3ms236 KiB
23Accepted3ms384 KiB
24Accepted3ms368 KiB
25Accepted3ms384 KiB
26Accepted3ms360 KiB
subtask40/40
27Wrong answer93ms1296 KiB
28Partially correct93ms1184 KiB
29Wrong answer74ms1268 KiB
30Partially correct93ms1208 KiB
31Wrong answer93ms1156 KiB
32Partially correct93ms1128 KiB
33Wrong answer74ms1128 KiB
34Wrong answer93ms1128 KiB
35Partially correct93ms1308 KiB
36Wrong answer82ms1272 KiB
37Accepted74ms1128 KiB
38Accepted43ms1272 KiB
39Accepted90ms1168 KiB
40Accepted92ms1128 KiB
41Accepted68ms1256 KiB
42Accepted92ms1128 KiB
43Accepted63ms1000 KiB