82822024-01-14 09:28:02MagyarKendeSZLGVirágos rét (50 pont)cpp17Wrong answer 42/5019ms4056 KiB
#include <bits/stdc++.h>
using namespace std;

int N, K, M, result;
int main() {
    cin >> N >> K;
    while (N--) {
        int x;
        cin >> x;
        M += x;
    }

    if (M < K) {
        cout << 0; exit(0);
    }
    
    for (int i = 1; i <= M - K + 1; i++) {;
        result += M - (i + K) + 2;
    }

    cout << result;
}
SubtaskSumTestVerdictTimeMemory
base42/50
1Accepted0/03ms1872 KiB
2Accepted0/03ms2124 KiB
3Accepted0/019ms2340 KiB
4Accepted2/23ms2496 KiB
5Accepted2/23ms2600 KiB
6Accepted2/23ms2732 KiB
7Accepted3/33ms2976 KiB
8Accepted3/33ms3032 KiB
9Accepted3/33ms3152 KiB
10Accepted2/23ms3376 KiB
11Accepted3/33ms3592 KiB
12Accepted2/23ms3668 KiB
13Accepted3/33ms3796 KiB
14Accepted2/217ms3884 KiB
15Wrong answer0/218ms3880 KiB
16Accepted3/319ms3856 KiB
17Accepted3/318ms3852 KiB
18Wrong answer0/319ms3856 KiB
19Accepted3/319ms4004 KiB
20Accepted3/319ms4004 KiB
21Accepted3/319ms3996 KiB
22Wrong answer0/318ms4056 KiB