119112024-11-19 18:49:49banhelyiVirágos rét (50 pont)cpp17Wrong answer 32/5018ms764 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*(ja-1)/2-(ja-1)*(k-2)+(k-2)*(k-3)/2;
    cout << ((jo>0)?jo:0) << "\n";

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base32/50
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Accepted0/018ms332 KiB
4Accepted2/21ms320 KiB
5Wrong answer0/21ms320 KiB
6Wrong answer0/21ms508 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms320 KiB
9Accepted3/31ms320 KiB
10Accepted2/21ms508 KiB
11Accepted3/31ms320 KiB
12Accepted2/21ms320 KiB
13Accepted3/31ms616 KiB
14Accepted2/217ms500 KiB
15Wrong answer0/217ms404 KiB
16Wrong answer0/317ms400 KiB
17Accepted3/317ms396 KiB
18Wrong answer0/318ms408 KiB
19Accepted3/318ms500 KiB
20Wrong answer0/317ms400 KiB
21Accepted3/318ms400 KiB
22Wrong answer0/318ms764 KiB