119172024-11-19 18:57:39banhelyiVirágos rét (50 pont)cpp17Wrong answer 4/5017ms508 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    int k;
    int szam;
    int ja=0;
    int j;
    cin >> n;
    cin >> k;
    for(int i=0; i < n; i++){
        cin >> j;
        ja += j;
    }
	int jo=(ja-1)-(k);
    jo=(jo+1)*(jo)/2;
    cout << (((ja-1)>=k)?jo:0) << "\n";

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base4/50
1Wrong answer0/01ms320 KiB
2Accepted0/01ms320 KiB
3Wrong answer0/017ms404 KiB
4Wrong answer0/21ms320 KiB
5Accepted2/21ms508 KiB
6Accepted2/21ms320 KiB
7Wrong answer0/31ms336 KiB
8Wrong answer0/31ms320 KiB
9Wrong answer0/31ms368 KiB
10Wrong answer0/21ms380 KiB
11Wrong answer0/31ms320 KiB
12Wrong answer0/21ms320 KiB
13Wrong answer0/31ms324 KiB
14Wrong answer0/216ms408 KiB
15Wrong answer0/217ms400 KiB
16Wrong answer0/317ms400 KiB
17Wrong answer0/317ms404 KiB
18Wrong answer0/317ms508 KiB
19Wrong answer0/317ms400 KiB
20Wrong answer0/317ms400 KiB
21Wrong answer0/317ms404 KiB
22Wrong answer0/317ms508 KiB