125502024-12-22 20:28:57BucsMateVirágos rét (50 pont)cpp17Wrong answer 42/5017ms560 KiB
#include <iostream>

using namespace std;

int main()
{
    int N, K;
    cin >> N >> K;
    int nr = 0;
    int temp;
    for(int i = 0; i < N; i++){
        cin >> temp;
        nr += temp;
    }
    if(K > nr){
        cout << 0 << endl;
    }
    else{
        cout << (nr-K+2)*(nr-K+1)/2 << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base42/50
1Accepted0/01ms320 KiB
2Accepted0/01ms560 KiB
3Accepted0/017ms320 KiB
4Accepted2/21ms320 KiB
5Accepted2/21ms320 KiB
6Accepted2/21ms396 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms320 KiB
9Accepted3/31ms348 KiB
10Accepted2/21ms320 KiB
11Accepted3/31ms320 KiB
12Accepted2/21ms320 KiB
13Accepted3/31ms556 KiB
14Accepted2/216ms404 KiB
15Wrong answer0/217ms404 KiB
16Accepted3/317ms404 KiB
17Accepted3/317ms400 KiB
18Wrong answer0/317ms332 KiB
19Accepted3/317ms404 KiB
20Accepted3/317ms400 KiB
21Accepted3/317ms404 KiB
22Wrong answer0/317ms404 KiB